Closed picasa closed 6 years ago
Ok. I confirm.
I will replace the printf() family function with the Rprintf() family.
Badly, with the current rvle state, we cannot provide a function to change the verbosity level.
just to provide a small test for silencing functions :
silence <- function(expr) {
capture.output(x <- suppressMessages(suppressWarnings(expr)))
invisible(x)
}
noise <- function(n) {
cat("CAT"); message("MESSAGE"); print("PRINT"); warning("WARNING")
rnorm(n)
}
> noise(1)
CATMESSAGE
[1] "PRINT"
[1] 0.5368348
Warning message:
In noise(1) : WARNING
> silence(noise(1))
> x <- silence(noise(1))
> x
[1] 0.5615403
> silence(run(sunflo))
rvle_experiment_set_seed is unavailable.Context initialized [prefix=/usr/local] [home=/home/casadebaig/.vle]
very noisy run :)
very noisy run :)
:)
Do you use latest version for both vle and rvle ?
vle version is beta2, rvle version is 24ed3d3. This is not a blocking problem, but as I tested this function on another context, I gave it a try for rvle::run and could not explain the behavior.
The following patchs must fix this issues (in stable vle and rvle): https://github.com/vle-forge/vle/commit/a96fa1d263f2c18bb90222287d219ef6812f9374 https://github.com/vle-forge/rvle/commit/24ed3d30e80925ef12cf9b8ac7c998f6a3b10dca
since -beta1, rvle::new or rvle::run print informations on R console
However, some output are catchable (the string
rvle_experiment_get_seed is unavailable.
)