I'm trying to plot some time-series data in R using the dygraphs package (I'm an R newbie), but having trouble and I suspect it's due to data format issues.
Here is a sample of my code:
df <- select(sal_data,DateTime,'Sal psu')
head(df)
typeof(df)
class(df)
outputs:
DateTime
<S3: POSIXct>
Sal psu
<dbl>
2018-05-03 14:30:01 24.93
2018-05-03 14:45:01 24.94
2018-05-03 15:00:01 24.90
2018-05-03 15:15:01 24.89
2018-05-03 15:30:01 24.94
2018-05-03 15:45:01 24.87
and
[1] "list"
[1] "tbl_df" "tbl" "data.frame"
but when I try to do dygraph(as.xts(df))
I get:
Error in as.POSIXlt.character(x, tz, ...) : character string is not in a standard unambiguous format
Any thoughts? This seems like a simple fix but my searching hasn't found anything. Thanks!