0

upon giving the following command it gives and error related to time. I tried reading .CSV . column as date and time, still the problem was same. I am not sure what is the issue with dates or format. the date and time format for the data is dd/mm/yyyy hr:min where as upon working with the exercise sample command works fine. i.e

summaryPlot(package_exercisesample)


rm(list = ls())

library(lubridate)

library(readr)

library(openair)

package_exercisesample<- openair::mydata

dat<- read_csv("data.csv")

summaryPlot(dat)

This is the error i am getting

Parsed with column specification:

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)

Error in 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'.

*dput(head(mydata,12))

structure(list(date = structure(c(883612800, 883616400, 883620000, 883623600, 883627200, 883630800, 883634400, 883638000, 883641600, 883645200, 883648800, 883652400), class = c("POSIXct", "POSIXt" ), tzone = "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.3475, 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_)), row.names = c(NA, -12L), class = c("tbl_df", "tbl", "data.frame"))*

Sorry, issue got resolved with changing the column name of input date data as "date" instead of "Date"

jayesh
  • 3
  • 2

0 Answers0