[R] Formatting Syntax when Merging

Jia Ying Mei jiamei at Princeton.EDU
Thu Jul 24 19:13:26 CEST 2008


Hi,

I've merged the attached two data sets, generating a final merged data 
set, but when I review this merged data, the dates are not in the 
correct order. I know that this can be solved by using something like 
fmt<-"%m/%d/%y", but where should this go in the commands below?

 > Countrydata<-read.table("Desktop/R/Countrydata.txt", head=T, sep="\t")
 > Dates<-read.table("Desktop/R/CDSdate.txt", head=T, sep="\t")
 > Merged<-merge(Dates, Countrydata, all.x=T)
 > edit(Merged)

Also, I thought all.x=T was supposed to fill in every missing value with 
a NA? Why does it fill in NA for some and <NA> for others? Also, when I 
use the edit function, those with <NA> do not appear. Is this to 
distinguish between filled-in NAs and NAs in the data?

Any help would be appreciated, thanks!

Jia Ying Mei
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: CDSdate.txt
URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20080724/a5f150d4/attachment.txt>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: Countrydata.txt
URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20080724/a5f150d4/attachment-0001.txt>


More information about the R-help mailing list