[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

[R] How to join data.frames with different row lengths

2014-03-24 Thread Megan Weigel
Hello, I need to combine two data sets into one. For example: Dataset1: Code Cap04 2120 6 75 7220 17 4 Dataset2: Code Cap08 2120 7112 9190 17 4 I need the dataset to look like the following where it keeps every unique 'code'