Description Super classes Methods
General timeseries processing
General timeseries processing
ukcovidtools::PassthroughFilesystemCache
-> ukcovidtools::DataProvider
-> ukcovidtools::CovidTimeseriesProvider
-> TimeseriesProcessingPipeline
new()
TimeseriesProcessingPipeline$new(providerController, ...)
incidenceFromCumulative()
TimeseriesProcessingPipeline$incidenceFromCumulative(covidTimeseries, ...)
cumulativeFromIncidence()
TimeseriesProcessingPipeline$cumulativeFromIncidence(covidTimeseries, ...)
aggregateRagged()
TimeseriesProcessingPipeline$aggregateRagged( groupedDf, originalVar, aggregateVars, ..., fn = sum, dateVar = "date", valueVars = vars(value) )
aggregateAge()
TimeseriesProcessingPipeline$aggregateAge(covidTimeseries, fn = sum, ...)
aggregateGender()
TimeseriesProcessingPipeline$aggregateGender(covidTimeseries, fn = sum, ...)
aggregateSubgroup()
TimeseriesProcessingPipeline$aggregateSubgroup(covidTimeseries, fn = sum, ...)
aggregateSource()
TimeseriesProcessingPipeline$aggregateSource( covidTimeseries, namedListOfSources = list(`All sources` = unique(covidTimeseries$source)), fn = sum, ... )
aggregateGeography()
TimeseriesProcessingPipeline$aggregateGeography( covidTimeseries, targetCodeTypes, completeness = "source", fn = sum, ... )
completeness
should the mapping be complete? if the mapping is "source" complete it will only be successful if all source codes are present when mapping to a higher region. if the mapping is target, then only if all the target codes are represented. Or both if the mapping must be complete at both ends.
imputeAndWeeklyAverage()
TimeseriesProcessingPipeline$imputeAndWeeklyAverage( covidTimeseries, window = 7, ... )
removeZeroDays()
TimeseriesProcessingPipeline$removeZeroDays(r0Timeseries, valueVar = "value")
completeAndRemoveAnomalies()
TimeseriesProcessingPipeline$completeAndRemoveAnomalies( r0Timeseries, outlier_min = 10, outlier_sd = 5, window = 9, valueVar = "value", originalValueVar = "value.original", precision = 1e-05, allowZeroDays = FALSE )
smoothAndSlopeTimeseries()
Calculate an estimate of rate of change of Rt using a loess
TimeseriesProcessingPipeline$smoothAndSlopeTimeseries( r0Timeseries, smoothExpr, ..., window = 14, leftSided = TRUE )
R0timeseries
a grouped df contianing R0 timeseries including a date and a 'Median(R)' column from EpiEstim
logIncidenceStats()
TimeseriesProcessingPipeline$logIncidenceStats( covidTimeseries, valueVar = "value", growthRateWindow = 7, smoothingWindow = 14, earliestPossibleDate = "2020-02-01", ... )
estimateGrowthRate()
TimeseriesProcessingPipeline$estimateGrowthRate( covidTimeseries, window = 14, growthRateWindow = 7, leftSided = TRUE, ... )
estimateGrowthRate2()
TimeseriesProcessingPipeline$estimateGrowthRate2( covidTimeseries, window = 21, weekendEffect = 0.75, ... )
estimateRtQuick()
Calculates a survival R(t) curve on grouped data
TimeseriesProcessingPipeline$estimateRtQuick( covidTimeseries, valueVar = "RollMean.value", window = 7, ... )
covidTimeseries
a covid timeseries data frame
valueVar
- the column to calculate an R(t) for - usually "RollMean.value"
window
- the width of the smoothing function applied (default 2)
config
An object of class estimate_R_config, as returned by function EpiEstim::make_config.
a dataframe with groupwise Rt estimates
estimateRt()
Calculates a survival R(t) curve on grouped data
TimeseriesProcessingPipeline$estimateRt( covidTimeseries, valueVar = "RollMean.value", window = 7, priorR0 = 1, priorR0Sd = 2, quick = FALSE, serialIntervalProvider = self$serial, ... )
covidTimeseries
a covid timeseries data frame
valueVar
- the column to calculate an R(t) for - usually "RollMean.value"
window
- the width of the smoothing function applied (default 7)
config
An object of class estimate_R_config, as returned by function EpiEstim::make_config.
dateVar
- the variable containing the seqence of dates
incidenceVar
- the sequence of daily incidence
a dataframe with groupwise Rt estimates
defaultOffsetAssumptions()
TimeseriesProcessingPipeline$defaultOffsetAssumptions()
defaultCorrectionFactor()
TimeseriesProcessingPipeline$defaultCorrectionFactor()
defaultR0Assumptions()
TimeseriesProcessingPipeline$defaultR0Assumptions()
adjustRtConfidence()
TimeseriesProcessingPipeline$adjustRtConfidence( covidRtResult, sdMultiplier, predicate = NULL )
adjustRtDates()
TimeseriesProcessingPipeline$adjustRtDates( covidRtResult, window = 0, offsetAssumptions = self$defaultOffsetAssumptions(), extraCols = NULL )
adjustGrowthRateDates()
TimeseriesProcessingPipeline$adjustGrowthRateDates( covidRtResult, window = 0, offsetAssumptions = self$defaultOffsetAssumptions(), extraCols = NULL )
adjustRtCorrFac()
TimeseriesProcessingPipeline$adjustRtCorrFac( covidRtResult, window = 7, correctionFactor = self$defaultCorrectionFactor(), extraCols = NULL )
estimateRtWithAssumptions()
TimeseriesProcessingPipeline$estimateRtWithAssumptions( covidTimeseries, valueVar = "RollMean.value", window = 7, period = 28, quick = FALSE, r0Assumptions = self$defaultR0Assumptions(), serialIntervalProvider = self$serial, dateRange = as.Date(c(min(covidTimeseries$date), max(covidTimeseries$date)), "1970-01-01"), ... )
estimateVolatilty()
calculate a volatility statistic for the timeseries based on previous N days
TimeseriesProcessingPipeline$estimateVolatilty( covidTimeseries, valueVar, outputVar = NULL, window = 28 )
valueVar
- value for which the volatility being calculated
window
- The number of time points to consider
df
a df containing a timeseries
This will not work well for timeseries with NAs
$x+y=z$
plotRt()
Plot the EpiEstim output in a standard way
TimeseriesProcessingPipeline$plotRt( covidRtTimeseries, colour = NULL, events = self$datasets$getSignificantDates(1), rtlim = c(0.5, 2.5), dates = NULL, jepidemicMode = any(self$jepidemicCols %in% colnames(covidRtTimeseries)), ribbons = TRUE, ... )
rtlim
- the max and min or Rt to display
dates
- the min (and optionally max) dates to display as a YYYY-MM-DD character (or anything that can be coerced to a Date)
df
a df containing an Rt timeseries, including a date and a 'Median(R)' column from EpiEstim
group
- the colour aesthetic
dateVar
- the name of the date column
facetVars
- the facetting variables
features
-
plotGrowthRate()
Plot the growth rate
TimeseriesProcessingPipeline$plotGrowthRate( covidRtTimeseries, colour = NULL, events = self$datasets$getSignificantDates(1), rlim = c(-0.25, 0.25), dates = NULL, ribbons = TRUE, growthVar = "Growth.value", growthLowerVar = "Growth.Quantile.0.025.value", growthHigherVar = "Growth.Quantile.0.975.value", growthSEVar = NULL, ... )
colour
- the colour aesthetic
rlim
- the max and min or Rt to display
dates
- the min (and optionally max) dates to display as a YYYY-MM-DD character (or anything that can be coerced to a Date)
ribbons
- display the confidence limit as ribbons
df
a df containing an Rt timeseries, including a date and a 'Median(R)' column from EpiEstim
plotGrowthIncidence()
TimeseriesProcessingPipeline$plotGrowthIncidence( groupedCovidRtTimeseries, plotDates = NULL, timespan = 15, colour = NULL, populationAdj = TRUE, showConfInt = TRUE, showHistorical = TRUE, maxAlpha = 0.6, rlim = c(-0.15, 0.15), ilim = c(0, NA), maxSize = 6, ... )
gogPlot()
TimeseriesProcessingPipeline$gogPlot(...)
plotEvents()
TimeseriesProcessingPipeline$plotEvents( events, labelSize = 7, labelY = Inf, ... )
plotDefault()
TimeseriesProcessingPipeline$plotDefault( data, events = NULL, dates = NULL, ylim = NULL, labelSize = 7, ... )
plotIncidenceQuantiles()
TimeseriesProcessingPipeline$plotIncidenceQuantiles( covidTimeseries, denominatorExpr = NULL, colour = NULL, events = self$datasets$getSignificantDates(1), dates = NULL, ribbons = TRUE, ylim = c(0, NA), ... )
plotIncidenceRollmean()
TimeseriesProcessingPipeline$plotIncidenceRollmean( covidTimeseries, denominatorExpr = NULL, events = self$datasets$getSignificantDates(1), dates = NULL, ylim = c(0, NA), ... )
clone()
The objects of this class are cloneable with this method.
TimeseriesProcessingPipeline$clone(deep = FALSE)
deep
Whether to make a deep clone.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.