Closed bernt-matthias closed 2 years ago
Hmm works fine here
library(ampvis2)
#> Loading required package: ggplot2
AalborgWWTPs$metadata$Date <- as.character(AalborgWWTPs$metadata$Date)
amp_timeseries(AalborgWWTPs, time_variable = "Date", format = "%Y-%m-%d", group_by = "Plant")
#>
#> Attaching package: 'lubridate'
#> The following objects are masked from 'package:base':
#>
#> date, intersect, setdiff, union
Created on 2022-01-05 by the reprex package (v2.0.1)
I loaded the time columns as factors .. remember that I read somewhere that time columns should be loaded as character / factor. You can reproduce the error (if it is one) with:
library(ampvis2)
AalborgWWTPs$metadata$Date <- as.factor(AalborgWWTPs$metadata$Date)
amp_timeseries(AalborgWWTPs, time_variable = "Date", format = "%Y-%m-%d", group_by = "Plant")
I'll close this. Dates are just pesky. It's best if the particular column is already a properly formatted date class before loading the data. The ...
passed to lubridate::as_date
is just there for an extra convenience.
If I use the
format
argument for theamp_timeseries
function I getSeems that lubridate::as_date no longer supports this (https://github.com/tidyverse/lubridate/issues/607)