Cómo ocultar o deshabilitar el mensaje impreso en función
Supongamos que tengo una función como:
ff <- function(x) {
cat(x, "\n")
x^2}
Y ejecutarlo por:
y <- ff(5)
# 5
y
# [1] 25
Mi pregunta es cómo deshabilitar u ocultar el5
impreso desdecat(x, "\n")
como:
y <- ff(5)
y
# [1] 25