Re: [R] How to create an ifelse statement where it matches a different data.frame variable

2014-03-26 Thread Jeff Newmiller
Please keep the mailing list included by using "reply-all"... I am not doing this as a private consultation. Your sample data is a step forward, but it is still not reproducible. You could Google "R reproducible example" and find http://stackoverflow.com/questions/5963269/how-to-make-a-great-r

Re: [R] How to create an ifelse statement where it matches a different data.frame variable

2014-03-26 Thread Jeff Newmiller
Please read and in the future follow the Posting Guide, which requests that you provide a reproducible example... that is, a series of R statements that we can run to get us to your problem point with a small sample data set that resembles yours. Forging on anyway... The ifelse function applies

[R] How to create an ifelse statement where it matches a different data.frame variable

2014-03-26 Thread Megan Weigel
Hello, Hopefully there is an answer for this, but I need an ifelse statement that replaces and returns a value based on a different dataframe. For example: CurrentDataFrame<-ifelse(CurrentDataFrame$Name=="NA",match(CurrentDataFrame$Code with PastDataFrame$Code),replace(CurrentDataFrame$Name) with