[R] Printing matrix/table in a procedure

Steven Yen @tyen @end|ng |rom ntu@edu@tw
Wed May 15 11:33:46 CEST 2019


Dear All,

I would like to get a matrix (table) printed in a procedure, as 
attempted below. Please help. Thanks.

test<-function(x){
   table<-matrix(x,nrow=4)
   cat("\nTable:\n",table)
invisible(list(table=table))
}

x<-1:20
test(x)

-- 
styen using ntu.edu.tw (S.T. Yen)


	[[alternative HTML version deleted]]



More information about the R-help mailing list