Dear all, i have a problem with processing dataframes within a function using the "$". Here´s my code:
recode_items = function(dataframe,number,medium=2){ # this works q<-paste("columna",number,sep="") # this does not work, particularly because "dataframe" is not processed # dataframe should be: givenframe$columnagivennumber a=dataframe$q[dataframe$q==medium]=1 return(a) } If I call this function, i´d like it to return my dataframe. The problem appears to be somewhere around the $. I´m sure this not too hard, but somehow i am stuck. I´ll keep searchin the manuals. Thx for any help in advance. best matt [[alternative HTML version deleted]]
______________________________________________ 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.