[R] lapply without return values?

Rainer M Krug
Fri, 25 Jan 2008 08:34:32 -0000

Hi

I am looking for a function which is executing some code repeatedly,
exactly like lapply() and sappl() are doing, but do not return anything
as I am not interested in the return values.

An example would be:

 > p <- data.frame(runif(10), runif(10), runif(10))
 > lapply( p, function(ps) {x11(); plot(ps)} )

which results in three graphs and a printout:

$runif.10.
NULL

$runif.10..1
NULL

$runif.10..2
NULL

 >

How can I avoid this printout without using

tmp <- lapply( p, function(ps) {x11(); plot(ps)} )?

Thanks,

Rainer