[R] Subset a data frame with specific date
ani jaya
g@@@uu| @end|ng |rom gm@||@com
Tue Jan 14 08:00:45 CET 2020
Dear Jeff and Bert,
Thank you for your correction and explanation.
Yes, I need more study regarding date format and
sorry for HTML mail.
I was able to subset data that I want.
mjo30<-read.table("rmm.txt", header=FALSE, skip=4234, nrows=10957)
mjo30$V8<-NULL
names(mjo30)<-c("year","month","day", "rmm1","rmm2","phase","amp")
mjo3<-as.Date(with(mjo30,paste(year,month, day, sep="-")),"%Y-%m-%d")
mjo<-mjo30[which(mjo3%in%date),]
head(mjo)
year month day rmm1 rmm2 phase amp
115 1986 4 25 -0.319090 -0.363030 2 0.483332
526 1987 6 10 1.662870 0.291632 5 1.688250
977 1988 9 3 -0.604950 -0.299850 1 0.675181
1374 1989 10 5 0.972298 -0.461030 4 1.076060
1760 1990 10 26 -1.183110 -1.589810 2 1.981730
1953 1991 5 7 -0.317180 0.953061 7 1.004450
Best,
Ani
On Tue, Jan 14, 2020 at 3:56 PM ani jaya <gaaauul using gmail.com> wrote:
>
>
More information about the R-help
mailing list