[R] Subset a data frame with specific date
ani jaya
g@@@uu| @end|ng |rom gm@||@com
Tue Jan 14 05:53:38 CET 2020
Good morning R-Help,
I have a dataframe with 7 columns and 10000+ rows. I want to subset/extract
those data frame with specific date (not in order). Here the head of my
data frame:
head(mjo30) year month date rmm1 rmm2 phase amp
1 1986 1 1 -0.326480 -1.55895 2 1.59277
2 1986 1 2 -0.417700 -1.82689 2 1.87403
3 1986 1 3 0.032915 -2.40150 3 2.40172
4 1986 1 4 0.492743 -2.49216 3 2.54041
5 1986 1 5 0.585106 -2.76866 3 2.82981
6 1986 1 6 0.665013 -3.13883 3 3.20851
and here my specific date:
> date [1] "1986-04-25" "1987-06-10" "1988-09-03" "1989-10-05" "1990-10-26" "1991-05-07" "1992-11-19" "1993-01-23" "1994-12-04"
[10] "1995-05-11" "1996-10-04" "1997-04-29" "1998-04-08" "1999-01-16"
"2000-08-01" "2001-10-02" "2002-05-08" "2003-04-01"
[19] "2004-05-07" "2005-09-02" "2006-12-30" "2007-09-03" "2008-10-24"
"2009-11-14" "2010-07-05" "2011-04-30" "2012-05-21"
[28] "2013-04-07" "2014-05-07" "2015-07-26"
And also I was confused when I dput my date, it show like this:
> dput(date)structure(c(5958, 6369, 6820, 7217, 7603, 7796, 8358, 8423, 9103,
9261, 9773, 9980, 10324, 10607, 11170, 11597, 11815, 12143, 12545,
13028, 13512, 13759, 14176, 14562, 14795, 15094, 15481, 15802,
16197, 16642), class = "Date")
what is that mean? I mean why it is not recall the dates but some
values (5958,6369,7217,..)?
Any comment and recommendation is appreciate. Thank you.
Best,
Ani
[[alternative HTML version deleted]]
More information about the R-help
mailing list