Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 204771

subsetting yearmon objects

$
0
0

I have monthly data

library(zoo); library(data.table)
dat <- data.table(month=as.yearmon(paste0(“2019-0“,1:9), “%Y-%m“))

and I would like to subset it to months after, say, May 2019. Whereas

dat[month==“Apr 2019“]

works,

dat[month>“May 2019“]

does not. Is there a trick?


Viewing all articles
Browse latest Browse all 204771

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>