[R] merging data sets to match data to date

Henrique Dallazuanna
Wed, 13 Aug 2008 13:11:06 -0000

Try this:

x <- data.frame(Dates = seq(as.Date('2008-01-01'),
                                          as.Date('2008-01-31'), by =
'days'),
                       Values = sample(31))

subset(x, Dates %in% as.Date(c('2008-01-05', '2008-01-20')))

On 8/13/08, rcoder <mpdotbook at gmail.com> wrote:
>
> Hi everyone,
>
> I want to extract data from a data set according to dates specified in a
> vector. I have created a blank matrix with row names (dates) that I want to
> extract from the full data set. I have then performed a merge to try to o/p
> rows corresponding to common dates to a results matrix, but the operation
> did not fill the results matrix. Coulc anyone offer any advice to assist
> with this operation?
>
> Thanks,
>
> rcoder
> --
> View this message in context:
http://www.nabble.com/merging-data-sets-to-match-data-to-date-tp18962197p18962197.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>


--
Henrique Dallazuanna
Curitiba-Paran?-Brasil
25? 25' 40" S 49? 16' 22" O