I want a command (last line) that can return a matrix. I'm wondering
if there is a way to do so.

g<-function(x) {
  c(x,x)
}
lapply(1:10,g)
sapply(1:10,g)

sapply(paste(1:10, 1:10), strsplit, split=' ')# I want a command that
returns a matrix

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to