Re: [R] Erroneous Column Removing Result From User-Defined Function.....

2013-12-26 Thread Adams, Jean
Levent, I would suggest that you get your data the way you want it first, then use the assign() function at the very end of your for() loop. I also think you could simplify the arguments in your assign() function. myfun <- function(dyolu, dadi, dsayi) { for(i in 1:dsayi) { ad <- paste(dadi, i, s

Re: [R] Erroneous Column Removing Result From User-Defined Function.....

2013-12-25 Thread Jeff Newmiller
You have pasted together a string, and are now trying to treat it as a data frame? I am not surprised at this error message. Please take heed of this warning: you are in Circle 6 of the R Inferno [1], and would benefit greatly from learning to put your multiple-but-similarly-structured data in

[R] Erroneous Column Removing Result From User-Defined Function.....

2013-12-25 Thread Levent TERLEMEZ
Dear Users, I have a little problem with user-defined function. I would like to remove columns from a data frame using a user-defined function but i am getting a "Error in ad[, -12] : incorrect number of dimensions” error. The "ad<-ad[,-12]” and similar commands work from R console but i couldn