[R] Manipulating two large dataset differing by date and time
giftedlife2014 at gmail.com
Mon Jan 22 09:07:06 CET 2018
Thank you so much for your attention. It handled the hourly data with ease.
On Mon, Jan 22, 2018 at 8:21 AM, Jim Lemon <drjimlemon at gmail.com> wrote:
> Hi Ogbos,
> You can just use ISOdate. If you pass more values, it will process them:
>  "2018-01-22 12:00:00 GMT"
> > ISOdate(2018,01,22,18,17)
>  "2018-01-22 18:17:00 GMT"
> Add something like:
> then pass data$hour as it will default to the same value as if you
> hadn't passed it.
> On Mon, Jan 22, 2018 at 6:01 PM, Ogbos Okike <giftedlife2014 at gmail.com>
> > Dear Members,
> > Compliments of the Season!!
> > Below is a part of a code I use for Fourier analysis of signals. The code
> > handles data with the format 05 01 01 8628 (year, month, day and
> > 05 01 02 8589 (year, month, day and
> > The sample data is attached as 2005daily.txt.
> > I would like to adapt the code to handle data of the form:
> > 05 01 01 00 4009 (year, month, day, hour and count)
> > 05 01 01 01 3969 (year, month, day, hour and count)
> > The sample is also attached as 2005hourly.txt.
> > Thank you very much for your kind inputs.
> > Ogbos
> > data <- read.table("2005daily.txt", col.names = c("year", "month", "day",
> > "counts"))
> > new.century <- data$year < 50
> > data$year <- ifelse(new.century, data$year + 2000, data$year + 1900)
> > data$date <- as.Date(ISOdate(data$year, data$month, data$day))
> > x1 = data$date
> > y = data$counts
> > ______________________________________________
> > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide http://www.R-project.org/
> > and provide commented, minimal, self-contained, reproducible code.
[[alternative HTML version deleted]]
More information about the R-help