[R] How to replace all commas with semicolon in a string

2016-05-31 Thread Mohammad Goodarzi
here is the solution to your question test <- data.frame(C1=c('a,b,c,d'),C2=c('g,h,f')) you should use gsub instead sub if you want it to be on all elements of each column tFun <- function(x) {gsub(",",";",x)} newTest <- apply(test, 2, tFun ) Cheers, [[alternative HTML version deleted]

[R] merging matrices

2013-10-21 Thread Mohammad Goodarzi
Dear all, I have to load more than 1000 matrices from desktop which all of them have the same size. If I do it manually, it would be very hard, can you please guide me how to load them and merge them together ? for example I want to put them one after another X1 X2 X3 etc Many thanks, Mohammad

[R] binding matrices

2013-10-16 Thread Mohammad Goodarzi
I have several matrices with the same size. I want to bind them one after another. Can you please let me know how to do it? Best Regards, Mohammad [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/ma