stsSD: Build sts object

Description Usage Arguments Value See Also Examples

View source: R/internal_functions.R

Description

Build sts surveillance object

Usage

1
stsSD(observedCases, studyPeriod, timeUnit = "Month", startYM = c(2000, 1) )

Arguments

observedCases

numeric vector of the number of cases by time unit (y axis of the time series)

studyPeriod

vector of dates of length(obeservedCases) (x axis of the time series)

timeUnit

character string for the time unit of the time series. Options are Week or Month.

startYM

numeric vector including Year and Month of start of the historical data

Value

sts

See Also

aggAtlasExport algoSD

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#-- Setting the parameters to run the report for
input <- list(
disease = "Salmonellosis",
country = "EU-EEA - complete series",
indicator = "Reported cases",
stratification = "Confirmed cases",
unit = "Month",
daterange = c("2010-01-01", "2016-12-31"),
algo = "FarringtonFlexible",
testingperiod = 5
)

#-- Example dataset
dataset <- EpiSignalDetection::SignalData

#-- Filtering on declared input parameters
dataset <- filterAtlasExport(dataset, input)

#-- Aggregating the data by geographical level and time point
dataset <- aggAtlasExport(dataset, input)

#-- Bulding the corresponding sts object
dataset.sts <- stsSD(observedCases = dataset$NumValue,
                     studyPeriod = dataset$StudyPeriod,
                     timeUnit = input$unit,
                     startYM = c(as.numeric(format(as.Date(input$daterange[1], "%Y-%m-%d"), "%Y")),
                                 as.numeric(format(as.Date(input$daterange[1], "%Y-%m-%d"), "%m"))))

EU-ECDC/EpiSignalDetection documentation built on May 26, 2019, 2:36 a.m.