在给出以下命令时,它会给出与时间相关的错误。我尝试阅读 .CSV 。列作为日期和时间,问题仍然相同。我不确定日期或格式有什么问题。数据的日期和时间格式为 dd/mm/yyyy hr:min,其中使用练习示例命令可以正常工作。IE
summaryPlot(package_exercisesample)
rm(list = ls())
library(lubridate)
library(readr)
library(openair)
package_exercisesample<- openair::mydata
dat<- read_csv("data.csv")
summaryPlot(dat)
这是我得到的错误
用列规范解析:
cols(
Date = col_character(),
ws = col_double(),
wd = col_double(),
Co = col_double(),
No = col_double(),
O3 = col_double(),
Pm2.5 = col_double(),
Pm10 = col_double(),
So2 = col_double()
)
summaryPlot(dat)
as.POSIXct.default(x) 中的错误:
. do not know how to convert 'x' to class “POSIXct”
In addition: Warning messages:
1: Unknown or uninitialised column: 'date'.
2: Unknown or uninitialised column: 'date'.
3: Unknown or uninitialised column: 'date'.
*输入(头(我的数据,12))
结构(列表(日期=结构(C(883612800,883616400,883620000,883623600,883623600,883627200,883630800,883634400,883634400,883638000) "GMT"), ws = c(0.6, 2.16, 2.76, 2.16, 2.4, 3, 3, 3, 3.36, 3.96, 6.36, 8.16), wd = c(280L, 230L, 190L, 170L, 180L, 190L, 140L, 170L, 170L, 170L, 180L, 190L), nox = c(285L, NA, NA, 493L, 468L, 264L, 171L, 195L, 137L, 113L, 100L, 109L), no2 = c(39L, NA, NA, 52L, 78L, 42L, 38L, 51L, 42L, 39L, 34L, 38L), o3 = c(1L, NA, 3L, 3L, 2L, 0L, 0L, 0L, 1L, 2L, 7L, 8L), pm10 = c(29L, 37L, 34L, 35L, 34L, 16L, 11L, 12L, 12L, 12L, 10L, 11L), so2 = c(4.7225, NA, 6.83, 7.6625, 8.07, 5.505, 4.23, 3.875, 3.4 , 2.9225, 3.06, 1.7475), co = c(3.3725, NA, 9.6025, 10.2175, 8.9125, 3.0525, 2.265, 1.995, 1。455, 1.205, 0.9825, 1.43), pm25 = c(NA_integer_, NA_integer_, NA_integer_, NA_integer_, NA_integer_, NA_integer_, NA_integer_, NA_integer_, NA_integer_, NA_integer_, NA_integer_, NA_integer_, NA_integer_, NA_integer_, -1), 行, 类 = c("tbl_df", "tbl", "data.frame"))*
抱歉,问题已通过将输入日期数据的列名更改为“日期”而不是“日期”来解决