(Iske <- matrix(c(1, 1, 1, 2, 2, 2, 10, 1, 1, 5, 1,2,2,2,1,1,1,4,4,4,4,3,3,3,30,3,3,3,3,3,3,3,5,4,4,4,4,4,44,2,2,2,2,4,5,5,5,5,5,5,5,5,95,1,2), ncol = 5)) numtochar <- function(Zahl){ text <- rawToChar(as.raw(Iske[1,]))} (Iske.char[]<-apply(Iske,1,numtochar))
I have a little problem with the command apply(). I want use the function numtochar for every row and the result should be a vector with the chars for every row. At the moment the function numtorow create a char with all items, but separate not every row. I think the function apply is the right way, bu I did not know how to use it at this example. Attention: At the real data set every row have a other length (!) ______________________________________________ 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.