[R] Manipulating two large dataset differing by date and time
Ogbos Okike
giftedlife2014 at gmail.com
Mon Jan 22 08:01:05 CET 2018
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 count)
05 01 02 8589 (year, month, day and count)
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
More information about the R-help
mailing list