Re: [R] apply with function

2011-10-20 Thread R. Michael Weylandt
Does this work? apply(Iske, 1, function(x) rawToChar(as.raw(x))) > apply(Iske, 1, function(x) rawToChar(as.raw(x))) [1] "\001\002\003\004\005" "\001\002\003\004\005" "\001\002\036\004\005" [4] "\002\001\003\004\005" "\002\001\003\004\005" "\002\001\003,\005" [7] "\n\004\003\002\005" "\001\00

[R] apply with function

2011-10-20 Thread Jörg Reuter
(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 comma