I am looking for a way to transform select observations based on a value based criteria. Why - Am learning r and would like to perform regression analysis of given variables of the babies dataset (part of UsingR) for example babies$wt1, the data in the variables does contain values which should be interpreted as unknown, some variables have 999 for unknown and some have 99 for the same, since lm() expects not available data to be marked using NA. I would like to use a solution that does not employ loops (I think it may not be the ideal way)
I am looking at using apply() and supply the name of my function responsible for transformation, but am unable to know now to reference the element of the vector/list being currently processed by apply() so I may do in place substitution (if value is 99 or 999) of the value with NA. ____________________________________________________________________________________ Pinpoint customers who are looking for what you sell. ______________________________________________ R-help@stat.math.ethz.ch 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.