Import package in PlotWeeklyClim and PlotForecastPDF
Hi @erifarov
I found some small things to be improved in PlotWeeklyClim() and PlotForecastPDF().
PlotWeeklyClim
- lubricate::year is used too but only ymd() is imported (https://earth.bsc.es/gitlab/es/esviz/-/blob/main/R/PlotWeeklyClim.R#L79) Actually, I don't know if it's worth getting rid of the dependency on lubridate, which is only used in PlotWeeklyClim(). If the function can be easily replaced, we can do that. Can you take a look? Thanks.
- It uses Apply(). Is it worth using Apply() or apply() can easily do the same thing? And how about the speed? If apply() is not suitable here and Apply() is slow, we can add
ncores
option in the function. - Minor suggestion: import only scale::date_format instead of the whole package (https://earth.bsc.es/gitlab/es/esviz/-/blob/main/R/PlotWeeklyClim.R#L75)
PlotForecastPDF
- no need to import plyr twice (https://earth.bsc.es/gitlab/es/esviz/-/blob/main/R/PlotForecastPDF.R#L55)
- Combine
data.table
import into one line
Cheers,
An-Chi