I have two data frames called "a1" and "a2" which I brought in by read.csv, with a column called "time" in each for which I used strptime to set the class as POSIXlt.
Prior to trying to merge the data frames I called arrange(a1, time)
and arrange(a2, time)
to get an oldest to newest order. I then tried to call ahu1 <- merge(a1, a2)
to start putting it all together and got the following error:
Error in sort.list(bx[m$xi]) : 'x' must be atomic for 'sort.list'
Have you called 'sort' on a list?
Calling str(a1)
and str(a2)
verifies that both are in fact data frames, and they have the same total number of observations. What am I missing or doing wrong?
structure(list(time = structure(list(sec = c(0, 0, 0, 0, 0, 0), min = c(0L, 15L, 30L, 45L, 0L, 15L), hour = c(10L, 10L, 10L, 10L, 11L, 11L), mday = c(24L, 24L, 24L, 24L, 24L, 24L), mon = c(1L,
1L, 1L, 1L, 1L, 1L), year = c(114L, 114L, 114L, 114L, 114L, 114L), wday = c(1L, 1L, 1L, 1L, 1L, 1L), yday = c(54L, 54L, 54L, 54L, 54L, 54L), isdst = c(0L, 0L, 0L, 0L, 0L, 0L), zone = c("MST",
"MST", "MST", "MST", "MST", "MST"), gmtoff = c(NA_integer_, NA_integer_, NA_integer_, NA_integer_, NA_integer_, NA_integer_)), .Names = c("sec", "min", "hour", "mday", "mon", "year", "wday", "yday", "isdst", "zone", "gmtoff"), class = c("POSIXlt", "POSIXt")), status.sf = c("TRUE", "TRUE", "TRUE", "TRUE", "TRUE", "TRUE"), status.rf = c("TRUE", "TRUE", "TRUE", "TRUE", "TRUE", "TRUE"), cfm.oa = c(1397.6, 343, 1265, 1500, 744.5, 1261.6), cfm.ra = c("2364.8", "3067.4", "2073.9", "2727.4", "2561.2", "2032.4"), temp.ra = c(68.6, 67.6, 69.1, 69.7, 67.9, 69), temp.ma = c(65.6, 65.8, 66.8, 67.9, 66.5, 68.2), temp.sa = c(51.1, 66.4, 68.6, 51.2, 67.3, 68), ductstatic = c(0.25, 0.25, 0.25, 0.47, 0.27, 0.25), fault.hum = c("FALSE", "FALSE", "FALSE", "FALSE", "FALSE", "FALSE"), fltpress = c(0.15, 0.12, 0.12, 0.22, 0.13, 0.13), fault.smoke = c("FALSE", "FALSE", "FALSE", "FALSE", "FALSE", "FALSE")), .Names = c("time", "status.sf", "status.rf", "cfm.oa", "cfm.ra", "temp.ra", "temp.ma", "temp.sa",
"ductstatic", "fault.hum", "fltpress", "fault.smoke"), row.names = c(NA, 6L), class = "data.frame")
structure(list(time = structure(list(sec = c(0, 0, 0, 0, 0, 0), min = c(0L, 15L, 30L, 45L, 0L, 15L), hour = c(10L, 10L, 10L, 10L, 11L, 11L), mday = c(24L, 24L, 24L, 24L, 24L, 24L), mon = c(1L, 1L, 1L, 1L, 1L, 1L), year = c(114L, 114L, 114L, 114L, 114L, 114L), wday = c(1L, 1L, 1L, 1L, 1L, 1L), yday = c(54L, 54L, 54L, 54L, 54L, 54L), isdst = c(0L, 0L, 0L, 0L, 0L, 0L), zone = c("MST", "MST", "MST", "MST", "MST", "MST"), gmtoff = c(NA_integer_, NA_integer_, NA_integer_, NA_integer_, NA_integer_, NA_integer_)), .Names = c("sec", "min", "hour", "mday", "mon", "year", "wday", "yday", "isdst", "zone", "gmtoff"), class = c("POSIXlt", "POSIXt")), occpt = c("TRUE", "TRUE", "TRUE", "TRUE", "TRUE", "TRUE"), max.dmprpos = c(77, 63, 71, 93, 63, 71), mode.ecm = c("TRUE", "TRUE", "TRUE", "TRUE", "TRUE", "TRUE"), mode.dehum = c("TRUE", "FALSE", "FALSE", "FALSE", "FALSE", "FALSE"), spt.sa = c("53", "66", "66", "66", "66", "66"
), spt.ductstatic = c("0.27", "0.25", "0.25", "0.57", "0.25", "0.25"), mode.co2 = c("FALSE", "FALSE", "FALSE", "FALSE", "FALSE", "FALSE"), mode.hum = c("FALSE", "FALSE", "FALSE", "FALSE", "FALSE", "FALSE"), max.runreqt = c("0", "0", "0", "0", "0", "0"), max.vavco2 = c("427", "429", "427", "414", "417", "406"), max.vavrhv = c("59", "56.4", "54.9", "56.1", "53.3", "50.1"), cfm.vavtot = c("2711", "2383.6",
"2395.8", "3702.9", "2449.8", "2388.4"), spt.cfm.ra = c("2461", "2133", "2144.3", "3433.7", "2198.8", "2139.3")), .Names = c("time", "occpt", "max.dmprpos", "mode.ecm", "mode.dehum", "spt.sa", "spt.ductstatic", "mode.co2", "mode.hum", "max.runreqt", "max.vavco2", "max.vavrhv", "cfm.vavtot", "spt.cfm.ra"), row.names = c(NA, 6L), class = "data.frame")