Error in names(data) == date : comparison (==) is possible only for atomic and list types

I have some data on electricity usage, when I run it on R I get this error

Date Original_Forecast Residual_Forecast Dispatchable_Generat…¹

1 2019-04-01 00:00:00 NA 20127. 21035.
2 2019-04-01 01:00:00 NA 19822. 20548.
3 2019-04-01 02:00:00 NA 19726. 20413.
4 2019-04-01 03:00:00 NA 19939. 20476.
5 2019-04-01 04:00:00 NA 20794. 21156.
6 2019-04-01 05:00:00 NA 22703. 23079.

:information_source: abbreviated name: ¹​Dispatchable_Generation

:information_source: 7 more variables: Residual_Demand , MLR , Installed ,

PCLF , UCLF , OCLF , UCLF_OCLF

res = cosinor(MLR ~ 1, date = Date,
+ data = load_2, type = 'hourly',
+ family = poisson(), offsetmonth = TRUE)

Error in names(data) == date :
comparison (==) is possible only for atomic and list types

Just a guess - should the column name Date be in quotes?

res = cosinor(MLR ~ 1, date = "Date",
 data = load_2, type = 'hourly',
 family = poisson(), offsetmonth = TRUE)

I have done that but now I ma getting a new error

res = cosinor(MLR ~ 1, date = "Date",

  • data = load_2, type = 'hourly', cycles = 1,
  • family = poisson(), offsetmonth = FALSE)
    Error in width - get_extent(prefix) :
    non-numeric argument to binary operator

class(load_2$MLR)
[1] "numeric"
class(load_2$Date)
[1] "POSIXct" "POSIXt"

This topic was automatically closed 42 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.