I'm relatively new to R and I'm trying to create some graphs from air quality data. I was able to follow the tutorials and achieve what I want, there is just one thing that does not work for me.
I have a CSV with one column Date, one Time and some other columns with data. I was able to use the selectbydate
method to extract certain period. Now what I need to do is combine two or more periods together into one dataset.
So far I have:
library(writexl)
library(openair)
dataSet <- import(file = "dataCSV.csv", file.type = "csv", sep = ";", header.at = 1, data.at = 2, date = "Date", date.format = "%d.%m.%Y", time = "Time", time.format = "%H:%M",quote = "\"")
x <- selectByDate(dataSet, start = "31/8/2018", end = "31/8/2018", hour = 21:23)
I then use "x" for the analysis and it works fine.
However when I try this:
x <- selectByDate(dataSet, start = "31/8/2018", end = "31/8/2018", hour = 21:23)
y <- selectByDate(dataSet, start = "1/9/2018", end = "1/9/2018", hour = 0)
z <- merge(x,y)
And I then try to pass "z" as the dataset later, I get
Error in matrix(unlist(value, recursive = FALSE, use.names = FALSE), nrow = nr, :
length of 'dimnames' [2] not equal to array extent
Thanks in advance for any help.