[R] apply vs. sapply

Christian Schulz ozric at web.de
Sat Dec 21 19:48:06 CET 2002


....hmm sorry "sometimes after several experiments" my graphic.device
(W2000/1.6.1)didn't popUp & only
a new start helps, but now it works :-)

# hermes is data.frame
apply(hermes,2,hist) #without names
sapply((1:ncol(hermes)),function(x) hist(hermes[,x],main=names(hermes)[x]))
#with col.names

thanks & regards,christian




More information about the R-help mailing list