Title: Retrieve and Explore ERVISS Respiratory Virus Surveillance Data
Version: 0.1.0
Description: Provides easy access to ERVISS (European Respiratory Virus Surveillance Summary) data from the EU-ECDC https://github.com/EU-ECDC/Respiratory_viruses_weekly_data. Enables retrieval, filtering, and optional visualization of data across European countries. Data is fetched directly from the EU-ECDC Respiratory Viruses Weekly Data repository, with support for both latest data and historical snapshots for reproducible analyses.
License: MIT + file LICENSE
URL: https://github.com/Epiconcept-Paris/ervissexplore, https://epiconcept-paris.github.io/ervissexplore/
BugReports: https://github.com/Epiconcept-Paris/ervissexplore/issues
Encoding: UTF-8
RoxygenNote: 7.3.3
Imports: cli, data.table, ggplot2
Suggests: knitr, rmarkdown, testthat (≥ 3.0.0)
Config/testthat/edition: 3
VignetteBuilder: knitr
NeedsCompilation: no
Packaged: 2026-02-16 08:58:47 UTC; Yohann Mansiaux
Author: Yohann Mansiaux [aut, cre]
Maintainer: Yohann Mansiaux <y.mansiaux@epiconcept.fr>
Repository: CRAN
Date/Publication: 2026-02-19 19:50:08 UTC

Get ERVISS data

Description

Retrieves and filters data from the ERVISS (European Respiratory Virus Surveillance Summary). This is a generic function that can retrieve any of the available data types.

Usage

get_erviss_data(
  type = ERVISS_TYPES,
  csv_file = NULL,
  date_min,
  date_max,
  pathogen = "",
  variant = "",
  indicator = "",
  age = "",
  countries = "",
  min_value = 0,
  use_snapshot = FALSE,
  snapshot_date = NULL
)

Arguments

type

Type of data. One of: "positivity", "variants", "ili_ari_rates", "sari_rates", "sari_positivity", "nonsentinel_severity", "nonsentinel_tests".

csv_file

Path to a local CSV file or URL containing the ERVISS data. If NULL (default), data is fetched from the official ERVISS repository.

date_min

Start date of the period (Date object)

date_max

End date of the period (Date object)

pathogen

Character vector of pathogen names to filter. Used for types: "positivity", "sari_positivity", "nonsentinel_severity", "nonsentinel_tests". Use "" (default) to include all pathogens.

variant

Character vector of variant names to filter. Only used for type = "variants". Use "" (default) to include all variants.

indicator

Character vector of indicators to filter. The available values depend on the data type. Use "" (default) to include all indicators.

age

Character vector of age groups to filter. Used for types: "ili_ari_rates", "sari_rates", "sari_positivity", "nonsentinel_severity", "nonsentinel_tests". Use "" (default) to include all age groups.

countries

Character vector of country names to filter. Use "" (default) to include all countries.

min_value

Minimum value threshold (default: 0). Only used for type = "variants".

use_snapshot

Logical. If TRUE, fetches a historical snapshot; if FALSE (default), fetches the latest data. Ignored if csv_file is provided.

snapshot_date

Date of the snapshot to retrieve. Required if use_snapshot = TRUE and csv_file is NULL.

Value

A data.table containing the filtered data.

Examples


# Get positivity data
data <- get_erviss_data(
  type = "positivity",
  date_min = as.Date("2024-01-01"),
  date_max = as.Date("2024-12-31"),
  pathogen = "SARS-CoV-2",
  countries = "France"
)

# Get ILI consultation rates
data <- get_erviss_data(
  type = "ili_ari_rates",
  date_min = as.Date("2024-01-01"),
  date_max = as.Date("2024-12-31"),
  indicator = "ILIconsultationrate",
  age = "total"
)

# Get non-sentinel severity data
data <- get_erviss_data(
  type = "nonsentinel_severity",
  date_min = as.Date("2024-01-01"),
  date_max = as.Date("2024-12-31"),
  pathogen = "SARS-CoV-2",
  indicator = "hospitaladmissions"
)


Get ERVISS data URL

Description

Builds the URL to download ERVISS data, either the latest batch or a specific snapshot.

Usage

get_erviss_url(type = ERVISS_TYPES, use_snapshot = FALSE, snapshot_date = NULL)

Arguments

type

Type of data. One of: "positivity", "variants", "ili_ari_rates", "sari_rates", "sari_positivity", "nonsentinel_severity", "nonsentinel_tests".

use_snapshot

Logical. If TRUE, returns a snapshot URL; if FALSE (default), returns the URL for the latest data.

snapshot_date

Date of the snapshot to retrieve (required if use_snapshot = TRUE). Must be a Date object.

Value

A character string containing the URL

Examples

# Get latest positivity data URL
get_erviss_url("positivity")

# Get latest variants data URL
get_erviss_url("variants")

# Get latest ILI/ARI rates data URL
get_erviss_url("ili_ari_rates")

# Get snapshot URL
get_erviss_url("variants", use_snapshot = TRUE, snapshot_date = as.Date("2023-11-24"))

Get ERVISS variants data

Description

Retrieves and filters SARS-CoV-2 variant data from the ERVISS (European Respiratory Virus Surveillance Summary) for a specified date range, variant(s), and country(ies).

Usage

get_erviss_variants(
  csv_file = NULL,
  date_min,
  date_max,
  variant = "",
  countries = "",
  min_value = 0,
  indicator = "",
  use_snapshot = FALSE,
  snapshot_date = NULL
)

Arguments

csv_file

Path to a local CSV file or URL containing the ERVISS data. If NULL (default), data is fetched from the official ERVISS repository.

date_min

Start date of the period (Date object)

date_max

End date of the period (Date object)

variant

Character vector of variant names to filter. Use "" (default) to include all variants.

countries

Character vector of country names to filter. Use "" (default) to include all countries.

min_value

Minimum value threshold to include in the results (default: 0)

indicator

Type of indicator: "proportion" or "detections". Use "" (default) to include all indicators.

use_snapshot

Logical. If TRUE, fetches a historical snapshot; if FALSE (default), fetches the latest data. Ignored if csv_file is provided.

snapshot_date

Date of the snapshot to retrieve. Required if use_snapshot = TRUE and csv_file is NULL.

Value

A data.table containing the filtered variant data with columns: date, value, variant, countryname, indicator, and other ERVISS fields.

Examples


# Get latest variant data for France
data <- get_erviss_variants(
  date_min = as.Date("2024-01-01"),
  date_max = as.Date("2024-12-31"),
  countries = "France"
)

# Get specific variants with minimum proportion threshold
data <- get_erviss_variants(
  date_min = as.Date("2024-06-01"),
  date_max = as.Date("2024-12-31"),
  variant = c("XFG", "LP.8.1"),
  min_value = 5
)


Get ERVISS variants data URL

Description

Builds the URL to download ERVISS variants data, either the latest batch or a specific snapshot.

Usage

get_erviss_variants_url(use_snapshot = FALSE, snapshot_date = NULL)

Arguments

use_snapshot

Logical. If TRUE, returns a snapshot URL; if FALSE (default), returns the URL for the latest data.

snapshot_date

Date of the snapshot to retrieve (required if use_snapshot = TRUE). Must be a Date object.

Value

A character string containing the URL

Examples

# Get latest data URL
get_erviss_variants_url()

# Get snapshot URL
get_erviss_variants_url(use_snapshot = TRUE, snapshot_date = as.Date("2023-11-24"))

Get ERVISS ILI/ARI consultation rates data

Description

Retrieves and filters ILI (Influenza-Like Illness) and ARI (Acute Respiratory Infection) consultation rates from the ERVISS (European Respiratory Virus Surveillance Summary) for a specified date range, indicator(s), age group(s), and country(ies).

Usage

get_ili_ari_rates(
  csv_file = NULL,
  date_min,
  date_max,
  indicator = "",
  age = "",
  countries = "",
  use_snapshot = FALSE,
  snapshot_date = NULL
)

Arguments

csv_file

Path to a local CSV file or URL containing the ERVISS data. If NULL (default), data is fetched from the official ERVISS repository.

date_min

Start date of the period (Date object)

date_max

End date of the period (Date object)

indicator

Character vector of indicators to filter: "ILIconsultationrate", "ARIconsultationrate", or both. Use "" (default) to include all indicators.

age

Character vector of age groups to filter (e.g., "0-4", "5-14", "15-64", "65+", "total"). Use "" (default) to include all age groups.

countries

Character vector of country names to filter. Use "" (default) to include all countries.

use_snapshot

Logical. If TRUE, fetches a historical snapshot; if FALSE (default), fetches the latest data. Ignored if csv_file is provided.

snapshot_date

Date of the snapshot to retrieve. Required if use_snapshot = TRUE and csv_file is NULL.

Value

A data.table containing the filtered ILI/ARI rates data with columns: survtype, countryname, date, indicator, age, value.

Examples


# Get ILI consultation rates for France
data <- get_ili_ari_rates(
  date_min = as.Date("2024-01-01"),
  date_max = as.Date("2024-12-31"),
  indicator = "ILIconsultationrate",
  countries = "France"
)

# Get both ILI and ARI rates for all countries
data <- get_ili_ari_rates(
  date_min = as.Date("2024-01-01"),
  date_max = as.Date("2024-12-31")
)


Get ERVISS ILI/ARI rates data URL

Description

Builds the URL to download ERVISS ILI/ARI consultation rates data, either the latest batch or a specific snapshot.

Usage

get_ili_ari_rates_url(use_snapshot = FALSE, snapshot_date = NULL)

Arguments

use_snapshot

Logical. If TRUE, returns a snapshot URL; if FALSE (default), returns the URL for the latest data.

snapshot_date

Date of the snapshot to retrieve (required if use_snapshot = TRUE). Must be a Date object.

Value

A character string containing the URL

Examples

# Get latest data URL
get_ili_ari_rates_url()

# Get snapshot URL
get_ili_ari_rates_url(use_snapshot = TRUE, snapshot_date = as.Date("2023-11-24"))

Get ERVISS non-sentinel severity data

Description

Retrieves and filters non-sentinel severity data (deaths, hospital admissions, ICU admissions, etc.) from the ERVISS (European Respiratory Virus Surveillance Summary) for a specified date range, pathogen(s), indicator(s), age group(s), and country(ies).

Usage

get_nonsentinel_severity(
  csv_file = NULL,
  date_min,
  date_max,
  pathogen = "",
  indicator = "",
  age = "",
  countries = "",
  use_snapshot = FALSE,
  snapshot_date = NULL
)

Arguments

csv_file

Path to a local CSV file or URL containing the ERVISS data. If NULL (default), data is fetched from the official ERVISS repository.

date_min

Start date of the period (Date object)

date_max

End date of the period (Date object)

pathogen

Character vector of pathogen names to filter. Use "" (default) to include all pathogens.

indicator

Character vector of indicators to filter: "deaths", "hospitaladmissions", "ICUadmissions", "ICUinpatients", "hospitalinpatients", or any combination. Use "" (default) to include all indicators.

age

Character vector of age groups to filter (e.g., "0-4", "5-14", "15-64", "65+", "total"). Use "" (default) to include all age groups.

countries

Character vector of country names to filter. Use "" (default) to include all countries.

use_snapshot

Logical. If TRUE, fetches a historical snapshot; if FALSE (default), fetches the latest data. Ignored if csv_file is provided.

snapshot_date

Date of the snapshot to retrieve. Required if use_snapshot = TRUE and csv_file is NULL.

Value

A data.table containing the filtered severity data with columns: survtype, countryname, date, pathogen, pathogentype, indicator, age, value.

Examples


# Get hospital admissions for SARS-CoV-2 in France
data <- get_nonsentinel_severity(
  date_min = as.Date("2024-01-01"),
  date_max = as.Date("2024-12-31"),
  pathogen = "SARS-CoV-2",
  indicator = "hospitaladmissions",
  countries = "France"
)

# Get all severity indicators
data <- get_nonsentinel_severity(
  date_min = as.Date("2024-01-01"),
  date_max = as.Date("2024-12-31"),
  pathogen = "SARS-CoV-2"
)


Get ERVISS non-sentinel severity data URL

Description

Builds the URL to download ERVISS non-sentinel severity data, either the latest batch or a specific snapshot.

Usage

get_nonsentinel_severity_url(use_snapshot = FALSE, snapshot_date = NULL)

Arguments

use_snapshot

Logical. If TRUE, returns a snapshot URL; if FALSE (default), returns the URL for the latest data.

snapshot_date

Date of the snapshot to retrieve (required if use_snapshot = TRUE). Must be a Date object.

Value

A character string containing the URL

Examples

# Get latest data URL
get_nonsentinel_severity_url()

# Get snapshot URL
get_nonsentinel_severity_url(use_snapshot = TRUE, snapshot_date = as.Date("2023-11-24"))

Get ERVISS non-sentinel tests/detections data

Description

Retrieves and filters non-sentinel virological testing data (tests and detections) from the ERVISS (European Respiratory Virus Surveillance Summary) for a specified date range, pathogen(s), indicator(s), age group(s), and country(ies).

Usage

get_nonsentinel_tests(
  csv_file = NULL,
  date_min,
  date_max,
  pathogen = "",
  indicator = "",
  age = "",
  countries = "",
  use_snapshot = FALSE,
  snapshot_date = NULL
)

Arguments

csv_file

Path to a local CSV file or URL containing the ERVISS data. If NULL (default), data is fetched from the official ERVISS repository.

date_min

Start date of the period (Date object)

date_max

End date of the period (Date object)

pathogen

Character vector of pathogen names to filter. Use "" (default) to include all pathogens.

indicator

Character vector of indicators to filter: "detections", "tests", or both. Use "" (default) to include all indicators.

age

Character vector of age groups to filter (e.g., "total"). Use "" (default) to include all age groups.

countries

Character vector of country names to filter. Use "" (default) to include all countries.

use_snapshot

Logical. If TRUE, fetches a historical snapshot; if FALSE (default), fetches the latest data. Ignored if csv_file is provided.

snapshot_date

Date of the snapshot to retrieve. Required if use_snapshot = TRUE and csv_file is NULL.

Value

A data.table containing the filtered non-sentinel tests data with columns: survtype, countryname, date, pathogen, pathogentype, pathogensubtype, indicator, age, value.

Examples


# Get non-sentinel detections for Influenza in France
data <- get_nonsentinel_tests(
  date_min = as.Date("2024-01-01"),
  date_max = as.Date("2024-12-31"),
  pathogen = "Influenza",
  indicator = "detections",
  countries = "France"
)

# Get all non-sentinel test data
data <- get_nonsentinel_tests(
  date_min = as.Date("2024-01-01"),
  date_max = as.Date("2024-12-31")
)


Get ERVISS non-sentinel tests/detections data URL

Description

Builds the URL to download ERVISS non-sentinel tests/detections data, either the latest batch or a specific snapshot.

Usage

get_nonsentinel_tests_url(use_snapshot = FALSE, snapshot_date = NULL)

Arguments

use_snapshot

Logical. If TRUE, returns a snapshot URL; if FALSE (default), returns the URL for the latest data.

snapshot_date

Date of the snapshot to retrieve (required if use_snapshot = TRUE). Must be a Date object.

Value

A character string containing the URL

Examples

# Get latest data URL
get_nonsentinel_tests_url()

# Get snapshot URL
get_nonsentinel_tests_url(use_snapshot = TRUE, snapshot_date = as.Date("2023-11-24"))

Get ERVISS SARI tests/detections/positivity data

Description

Retrieves and filters SARI (Severe Acute Respiratory Infection) virological data (tests, detections, positivity) from the ERVISS (European Respiratory Virus Surveillance Summary) for a specified date range, pathogen(s), indicator(s), age group(s), and country(ies).

Usage

get_sari_positivity(
  csv_file = NULL,
  date_min,
  date_max,
  pathogen = "",
  indicator = "",
  age = "",
  countries = "",
  use_snapshot = FALSE,
  snapshot_date = NULL
)

Arguments

csv_file

Path to a local CSV file or URL containing the ERVISS data. If NULL (default), data is fetched from the official ERVISS repository.

date_min

Start date of the period (Date object)

date_max

End date of the period (Date object)

pathogen

Character vector of pathogen names to filter. Use "" (default) to include all pathogens.

indicator

Character vector of indicators to filter: "positivity", "detections", "tests", or any combination. Use "" (default) to include all indicators.

age

Character vector of age groups to filter (e.g., "total", "0-4", "5-14", "15-64", "65+"). Use "" (default) to include all age groups.

countries

Character vector of country names to filter. Use "" (default) to include all countries.

use_snapshot

Logical. If TRUE, fetches a historical snapshot; if FALSE (default), fetches the latest data. Ignored if csv_file is provided.

snapshot_date

Date of the snapshot to retrieve. Required if use_snapshot = TRUE and csv_file is NULL.

Value

A data.table containing the filtered SARI data with columns: survtype, countryname, date, pathogen, pathogentype, pathogensubtype, indicator, age, value.

Examples


# Get SARI positivity data for Influenza in France
data <- get_sari_positivity(
  date_min = as.Date("2024-01-01"),
  date_max = as.Date("2024-12-31"),
  pathogen = "Influenza",
  indicator = "positivity",
  countries = "France"
)

# Get all SARI indicators for SARS-CoV-2
data <- get_sari_positivity(
  date_min = as.Date("2024-01-01"),
  date_max = as.Date("2024-12-31"),
  pathogen = "SARS-CoV-2"
)


Get ERVISS SARI tests/detections/positivity data URL

Description

Builds the URL to download ERVISS SARI virological data, either the latest batch or a specific snapshot.

Usage

get_sari_positivity_url(use_snapshot = FALSE, snapshot_date = NULL)

Arguments

use_snapshot

Logical. If TRUE, returns a snapshot URL; if FALSE (default), returns the URL for the latest data.

snapshot_date

Date of the snapshot to retrieve (required if use_snapshot = TRUE). Must be a Date object.

Value

A character string containing the URL

Examples

# Get latest data URL
get_sari_positivity_url()

# Get snapshot URL
get_sari_positivity_url(use_snapshot = TRUE, snapshot_date = as.Date("2023-11-24"))

Get ERVISS SARI rates data

Description

Retrieves and filters SARI (Severe Acute Respiratory Infection) rates from the ERVISS (European Respiratory Virus Surveillance Summary) for a specified date range, age group(s), and country(ies).

Usage

get_sari_rates(
  csv_file = NULL,
  date_min,
  date_max,
  age = "",
  countries = "",
  use_snapshot = FALSE,
  snapshot_date = NULL
)

Arguments

csv_file

Path to a local CSV file or URL containing the ERVISS data. If NULL (default), data is fetched from the official ERVISS repository.

date_min

Start date of the period (Date object)

date_max

End date of the period (Date object)

age

Character vector of age groups to filter (e.g., "0-4", "5-14", "15-64", "65+", "total"). Use "" (default) to include all age groups.

countries

Character vector of country names to filter. Use "" (default) to include all countries.

use_snapshot

Logical. If TRUE, fetches a historical snapshot; if FALSE (default), fetches the latest data. Ignored if csv_file is provided.

snapshot_date

Date of the snapshot to retrieve. Required if use_snapshot = TRUE and csv_file is NULL.

Value

A data.table containing the filtered SARI rates data with columns: survtype, countryname, date, indicator, age, value.

Examples


# Get SARI rates for Spain
data <- get_sari_rates(
  date_min = as.Date("2025-01-01"),
  date_max = as.Date("2025-12-31"),
  countries = "Spain"
)

# Get SARI rates for specific age groups
data <- get_sari_rates(
  date_min = as.Date("2024-01-01"),
  date_max = as.Date("2024-12-31"),
  age = c("0-4", "65+")
)


Get ERVISS SARI rates data URL

Description

Builds the URL to download ERVISS SARI rates data, either the latest batch or a specific snapshot.

Usage

get_sari_rates_url(use_snapshot = FALSE, snapshot_date = NULL)

Arguments

use_snapshot

Logical. If TRUE, returns a snapshot URL; if FALSE (default), returns the URL for the latest data.

snapshot_date

Date of the snapshot to retrieve (required if use_snapshot = TRUE). Must be a Date object.

Value

A character string containing the URL

Examples

# Get latest data URL
get_sari_rates_url()

# Get snapshot URL
get_sari_rates_url(use_snapshot = TRUE, snapshot_date = as.Date("2023-11-24"))

Get ERVISS sentinel tests data

Description

Retrieves and filters sentinel surveillance data (positivity, detections, tests) from the ERVISS (European Respiratory Virus Surveillance Summary) for a specified date range, pathogen(s), indicator(s), and country(ies).

Usage

get_sentineltests_positivity(
  csv_file = NULL,
  date_min,
  date_max,
  pathogen = "",
  indicator = "",
  countries = "",
  use_snapshot = FALSE,
  snapshot_date = NULL
)

Arguments

csv_file

Path to a local CSV file or URL containing the ERVISS data. If NULL (default), data is fetched from the official ERVISS repository.

date_min

Start date of the period (Date object)

date_max

End date of the period (Date object)

pathogen

Character vector of pathogen names to filter. Use "" (default) to include all pathogens.

indicator

Character vector of indicators to filter: "positivity", "detections", "tests", or any combination. Use "" (default) to include all indicators.

countries

Character vector of country names to filter. Use "" (default) to include all countries.

use_snapshot

Logical. If TRUE, fetches a historical snapshot; if FALSE (default), fetches the latest data. Ignored if csv_file is provided.

snapshot_date

Date of the snapshot to retrieve. Required if use_snapshot = TRUE and csv_file is NULL.

Value

A data.table containing the filtered data with columns: date, value, pathogen, countryname, indicator, and other ERVISS fields.

Examples


# Get latest SARS-CoV-2 positivity data for France
data <- get_sentineltests_positivity(
  date_min = as.Date("2024-01-01"),
  date_max = as.Date("2024-12-31"),
  pathogen = "SARS-CoV-2",
  countries = "France"
)

# Get detections and tests
data <- get_sentineltests_positivity(
  date_min = as.Date("2024-01-01"),
  date_max = as.Date("2024-12-31"),
  pathogen = "Influenza",
  indicator = c("detections", "tests")
)

# Get historical data from a specific snapshot
data <- get_sentineltests_positivity(
  date_min = as.Date("2023-01-01"),
  date_max = as.Date("2023-12-31"),
  use_snapshot = TRUE,
  snapshot_date = as.Date("2024-02-23")
)


Get ERVISS positivity data URL

Description

Builds the URL to download ERVISS positivity data, either the latest batch or a specific snapshot.

Usage

get_sentineltests_positivity_url(use_snapshot = FALSE, snapshot_date = NULL)

Arguments

use_snapshot

Logical. If TRUE, returns a snapshot URL; if FALSE (default), returns the URL for the latest data.

snapshot_date

Date of the snapshot to retrieve (required if use_snapshot = TRUE). Must be a Date object.

Value

A character string containing the URL

Examples

# Get latest data URL
get_sentineltests_positivity_url()

# Get snapshot URL
get_sentineltests_positivity_url(use_snapshot = TRUE, snapshot_date = as.Date("2023-11-24"))

Plot ERVISS data

Description

Creates a ggplot2 visualization of ERVISS data, with facets by country. This is a generic function that can plot any of the available data types.

Usage

plot_erviss_data(
  data,
  type = ERVISS_TYPES,
  date_breaks = NULL,
  date_format = "%b %Y"
)

Arguments

data

A data.table or data.frame containing ERVISS data, typically output from get_erviss_data.

type

Type of data. One of: "positivity", "variants", "ili_ari_rates", "sari_rates", "sari_positivity", "nonsentinel_severity", "nonsentinel_tests".

date_breaks

A string specifying the date breaks for the x-axis (e.g., "1 month", "2 weeks"). If NULL, a sensible default is chosen based on the data type.

date_format

A string specifying the date format for x-axis labels (e.g., "%b %Y" for "Jan 2024")

Value

A ggplot2 object

Examples


# Plot positivity data
data <- get_erviss_data("positivity",
  date_min = as.Date("2024-01-01"),
  date_max = as.Date("2024-06-30"),
  pathogen = "SARS-CoV-2"
)
plot_erviss_data(data, type = "positivity")

# Plot ILI/ARI rates
data <- get_erviss_data("ili_ari_rates",
  date_min = as.Date("2024-01-01"),
  date_max = as.Date("2024-06-30"),
  indicator = "ILIconsultationrate"
)
plot_erviss_data(data, type = "ili_ari_rates")


Plot ERVISS positivity data

Description

Creates a ggplot2 visualization of positivity data, with facets by country and colored by pathogen. The plot title displays mean, min and max positivity values.

Usage

plot_erviss_positivity(data, date_breaks = "2 weeks", date_format = "%b %Y")

Arguments

data

A data.table or data.frame containing positivity data, typically output from get_sentineltests_positivity. Must contain columns: date, value, pathogen, countryname.

date_breaks

A string specifying the date breaks for the x-axis (e.g., "1 month", "2 weeks")

date_format

A string specifying the date format for x-axis labels (e.g., "%b %Y" for "Jan 2024")

Value

A ggplot2 object

Examples


data <- get_sentineltests_positivity(
  date_min = as.Date("2024-01-01"),
  date_max = as.Date("2024-06-30"),
  pathogen = "SARS-CoV-2"
)
plot_erviss_positivity(data, date_breaks = "1 month")


Plot ERVISS variants data

Description

Creates a ggplot2 visualization of variant data, with facets by country and colored by variant. The y-axis shows percentage of all variants.

Usage

plot_erviss_variants(data, date_breaks = "1 month", date_format = "%b %Y")

Arguments

data

A data.table or data.frame containing variant data, typically output from get_erviss_variants. Must contain columns: date, value, variant, countryname.

date_breaks

A string specifying the date breaks for the x-axis (e.g., "1 month", "2 weeks")

date_format

A string specifying the date format for x-axis labels (e.g., "%b %Y" for "Jan 2024")

Value

A ggplot2 object

Examples


data <- get_erviss_variants(
  date_min = as.Date("2024-06-01"),
  date_max = as.Date("2024-12-31"),
  variant = c("XFG", "LP.8.1")
)
plot_erviss_variants(data, date_breaks = "1 month")


Plot ERVISS ILI/ARI consultation rates data

Description

Creates a ggplot2 visualization of ILI/ARI consultation rates, with facets by country and colored by age group.

Usage

plot_ili_ari_rates(data, date_breaks = "2 weeks", date_format = "%b %Y")

Arguments

data

A data.table or data.frame containing ILI/ARI rates data, typically output from get_ili_ari_rates. Must contain columns: date, value, age, countryname.

date_breaks

A string specifying the date breaks for the x-axis (e.g., "1 month", "2 weeks")

date_format

A string specifying the date format for x-axis labels (e.g., "%b %Y" for "Jan 2024")

Value

A ggplot2 object

Examples


data <- get_ili_ari_rates(
  date_min = as.Date("2024-01-01"),
  date_max = as.Date("2024-06-30"),
  indicator = "ILIconsultationrate"
)
plot_ili_ari_rates(data, date_breaks = "1 month")


Plot ERVISS non-sentinel severity data

Description

Creates a ggplot2 visualization of non-sentinel severity data, with facets by country and colored by pathogen.

Usage

plot_nonsentinel_severity(
  data,
  date_breaks = "1 month",
  date_format = "%b %Y"
)

Arguments

data

A data.table or data.frame containing severity data, typically output from get_nonsentinel_severity. Must contain columns: date, value, pathogen, countryname.

date_breaks

A string specifying the date breaks for the x-axis (e.g., "1 month", "2 weeks")

date_format

A string specifying the date format for x-axis labels (e.g., "%b %Y" for "Jan 2024")

Value

A ggplot2 object

Examples


data <- get_nonsentinel_severity(
  date_min = as.Date("2024-01-01"),
  date_max = as.Date("2024-06-30"),
  pathogen = "SARS-CoV-2",
  indicator = "hospitaladmissions"
)
plot_nonsentinel_severity(data, date_breaks = "1 month")


Plot ERVISS non-sentinel tests/detections data

Description

Creates a ggplot2 visualization of non-sentinel tests/detections data, with facets by country and colored by pathogen.

Usage

plot_nonsentinel_tests(data, date_breaks = "1 month", date_format = "%b %Y")

Arguments

data

A data.table or data.frame containing non-sentinel tests data, typically output from get_nonsentinel_tests. Must contain columns: date, value, pathogen, countryname.

date_breaks

A string specifying the date breaks for the x-axis (e.g., "1 month", "2 weeks")

date_format

A string specifying the date format for x-axis labels (e.g., "%b %Y" for "Jan 2024")

Value

A ggplot2 object

Examples


data <- get_nonsentinel_tests(
  date_min = as.Date("2024-01-01"),
  date_max = as.Date("2024-06-30"),
  pathogen = "Influenza",
  indicator = "detections"
)
plot_nonsentinel_tests(data, date_breaks = "1 month")


Plot ERVISS SARI positivity data

Description

Creates a ggplot2 visualization of SARI positivity data, with facets by country and colored by pathogen.

Usage

plot_sari_positivity(data, date_breaks = "2 weeks", date_format = "%b %Y")

Arguments

data

A data.table or data.frame containing SARI positivity data, typically output from get_sari_positivity. Must contain columns: date, value, pathogen, countryname.

date_breaks

A string specifying the date breaks for the x-axis (e.g., "1 month", "2 weeks")

date_format

A string specifying the date format for x-axis labels (e.g., "%b %Y" for "Jan 2024")

Value

A ggplot2 object

Examples


data <- get_sari_positivity(
  date_min = as.Date("2024-01-01"),
  date_max = as.Date("2024-06-30"),
  pathogen = "Influenza",
  indicator = "positivity"
)
plot_sari_positivity(data, date_breaks = "1 month")


Plot ERVISS SARI rates data

Description

Creates a ggplot2 visualization of SARI rates, with facets by country and colored by age group.

Usage

plot_sari_rates(data, date_breaks = "2 weeks", date_format = "%b %Y")

Arguments

data

A data.table or data.frame containing SARI rates data, typically output from get_sari_rates. Must contain columns: date, value, age, countryname.

date_breaks

A string specifying the date breaks for the x-axis (e.g., "1 month", "2 weeks")

date_format

A string specifying the date format for x-axis labels (e.g., "%b %Y" for "Jan 2024")

Value

A ggplot2 object

Examples


data <- get_sari_rates(
  date_min = as.Date("2025-01-01"),
  date_max = as.Date("2025-06-30"),
  countries = "Spain"
)
plot_sari_rates(data, date_breaks = "1 month")


Quick plot of ERVISS data

Description

Convenience function that fetches and plots ERVISS data in one step. This is a generic function that can handle any of the available data types. For more control, use get_erviss_data followed by plot_erviss_data.

Usage

quick_plot_erviss_data(
  type = ERVISS_TYPES,
  csv_file = NULL,
  date_min,
  date_max,
  pathogen = "",
  variant = "",
  indicator = "",
  age = "",
  countries = "",
  min_value = 0,
  date_breaks = NULL,
  date_format = "%b %Y",
  use_snapshot = FALSE,
  snapshot_date = NULL
)

Arguments

type

Type of data. One of: "positivity", "variants", "ili_ari_rates", "sari_rates", "sari_positivity", "nonsentinel_severity", "nonsentinel_tests".

csv_file

Path to a local CSV file or URL containing the ERVISS data. If NULL (default), data is fetched from the official ERVISS repository.

date_min

Start date of the period (Date object)

date_max

End date of the period (Date object)

pathogen

Character vector of pathogen names to filter. Used for types: "positivity", "sari_positivity", "nonsentinel_severity", "nonsentinel_tests". Use "" (default) to include all pathogens.

variant

Character vector of variant names to filter. Only used for type = "variants". Use "" (default) to include all variants.

indicator

Character vector of indicators to filter. The available values depend on the data type. Use "" (default) to include all indicators.

age

Character vector of age groups to filter. Used for types: "ili_ari_rates", "sari_rates", "sari_positivity", "nonsentinel_severity", "nonsentinel_tests". Use "" (default) to include all age groups.

countries

Character vector of country names to filter. Use "" (default) to include all countries.

min_value

Minimum value threshold (default: 0). Only used for type = "variants".

date_breaks

A string specifying the date breaks for the x-axis (e.g., "1 month", "2 weeks"). If NULL, a sensible default is chosen based on the data type.

date_format

A string specifying the date format for x-axis labels (e.g., "%b %Y" for "Jan 2024")

use_snapshot

Logical. If TRUE, fetches a historical snapshot; if FALSE (default), fetches the latest data. Ignored if csv_file is provided.

snapshot_date

Date of the snapshot to retrieve. Required if use_snapshot = TRUE and csv_file is NULL.

Value

A ggplot2 object showing the data over time by country

Examples


# Quick visualization of positivity data
quick_plot_erviss_data(
  type = "positivity",
  date_min = as.Date("2024-01-01"),
  date_max = as.Date("2024-12-31"),
  pathogen = "SARS-CoV-2"
)

# Quick visualization of ILI rates
quick_plot_erviss_data(
  type = "ili_ari_rates",
  date_min = as.Date("2024-01-01"),
  date_max = as.Date("2024-12-31"),
  indicator = "ILIconsultationrate"
)


Quick plot of ERVISS positivity data

Description

Convenience function that fetches and plots ERVISS positivity data in one step. For more control, use get_sentineltests_positivity followed by plot_erviss_positivity.

Usage

quick_plot_erviss_positivity(
  csv_file = NULL,
  date_min,
  date_max,
  pathogen = "",
  indicator = "",
  countries = "",
  date_breaks = "2 weeks",
  date_format = "%b %Y",
  use_snapshot = FALSE,
  snapshot_date = NULL
)

Arguments

csv_file

Path to a local CSV file or URL containing the ERVISS data. If NULL (default), data is fetched from the official ERVISS repository.

date_min

Start date of the period (Date object)

date_max

End date of the period (Date object)

pathogen

Character vector of pathogen names to filter. Use "" (default) to include all pathogens.

indicator

Character vector of indicators to filter: "positivity", "detections", "tests", or any combination. Use "" (default) to include all indicators.

countries

Character vector of country names to filter. Use "" (default) to include all countries.

date_breaks

A string specifying the date breaks for the x-axis (e.g., "1 month", "2 weeks")

date_format

A string specifying the date format for x-axis labels (e.g., "%b %Y" for "Jan 2024")

use_snapshot

Logical. If TRUE, fetches a historical snapshot; if FALSE (default), fetches the latest data. Ignored if csv_file is provided.

snapshot_date

Date of the snapshot to retrieve. Required if use_snapshot = TRUE and csv_file is NULL.

Value

A ggplot2 object showing positivity over time by country and pathogen

Examples


# Quick visualization of latest data
quick_plot_erviss_positivity(
  date_min = as.Date("2024-01-01"),
  date_max = as.Date("2024-12-31"),
  pathogen = "SARS-CoV-2",
  date_breaks = "1 month"
)


Quick plot of ERVISS variants data

Description

Convenience function that fetches and plots ERVISS variant data in one step. For more control, use get_erviss_variants followed by plot_erviss_variants.

Usage

quick_plot_erviss_variants(
  csv_file = NULL,
  date_min,
  date_max,
  variant = "",
  countries = "",
  min_value = 0,
  indicator = "",
  date_breaks = "1 month",
  date_format = "%b %Y",
  use_snapshot = FALSE,
  snapshot_date = NULL
)

Arguments

csv_file

Path to a local CSV file or URL containing the ERVISS data. If NULL (default), data is fetched from the official ERVISS repository.

date_min

Start date of the period (Date object)

date_max

End date of the period (Date object)

variant

Character vector of variant names to filter. Use "" (default) to include all variants.

countries

Character vector of country names to filter. Use "" (default) to include all countries.

min_value

Minimum value threshold to include in the results (default: 0)

indicator

Type of indicator: "proportion" or "detections". Use "" (default) to include all indicators.

date_breaks

A string specifying the date breaks for the x-axis (e.g., "1 month", "2 weeks")

date_format

A string specifying the date format for x-axis labels (e.g., "%b %Y" for "Jan 2024")

use_snapshot

Logical. If TRUE, fetches a historical snapshot; if FALSE (default), fetches the latest data. Ignored if csv_file is provided.

snapshot_date

Date of the snapshot to retrieve. Required if use_snapshot = TRUE and csv_file is NULL.

Value

A ggplot2 object showing variant proportions over time by country

Examples


# Quick visualization of latest variant data
quick_plot_erviss_variants(
  date_min = as.Date("2024-06-01"),
  date_max = as.Date("2024-12-31"),
  variant = c("XFG", "LP.8.1"),
  date_breaks = "1 month"
)


Quick plot of ERVISS ILI/ARI consultation rates data

Description

Convenience function that fetches and plots ERVISS ILI/ARI consultation rates data in one step. For more control, use get_ili_ari_rates followed by plot_ili_ari_rates.

Usage

quick_plot_ili_ari_rates(
  csv_file = NULL,
  date_min,
  date_max,
  indicator = "",
  age = "",
  countries = "",
  date_breaks = "2 weeks",
  date_format = "%b %Y",
  use_snapshot = FALSE,
  snapshot_date = NULL
)

Arguments

csv_file

Path to a local CSV file or URL containing the ERVISS data. If NULL (default), data is fetched from the official ERVISS repository.

date_min

Start date of the period (Date object)

date_max

End date of the period (Date object)

indicator

Character vector of indicators to filter: "ILIconsultationrate", "ARIconsultationrate", or both. Use "" (default) to include all indicators.

age

Character vector of age groups to filter (e.g., "0-4", "5-14", "15-64", "65+", "total"). Use "" (default) to include all age groups.

countries

Character vector of country names to filter. Use "" (default) to include all countries.

date_breaks

A string specifying the date breaks for the x-axis (e.g., "1 month", "2 weeks")

date_format

A string specifying the date format for x-axis labels (e.g., "%b %Y" for "Jan 2024")

use_snapshot

Logical. If TRUE, fetches a historical snapshot; if FALSE (default), fetches the latest data. Ignored if csv_file is provided.

snapshot_date

Date of the snapshot to retrieve. Required if use_snapshot = TRUE and csv_file is NULL.

Value

A ggplot2 object showing ILI/ARI consultation rates over time by country and age group

Examples


# Quick visualization of ILI rates
quick_plot_ili_ari_rates(
  date_min = as.Date("2024-01-01"),
  date_max = as.Date("2024-12-31"),
  indicator = "ILIconsultationrate",
  date_breaks = "1 month"
)


Quick plot of ERVISS non-sentinel severity data

Description

Convenience function that fetches and plots ERVISS non-sentinel severity data in one step. For more control, use get_nonsentinel_severity followed by plot_nonsentinel_severity.

Usage

quick_plot_nonsentinel_severity(
  csv_file = NULL,
  date_min,
  date_max,
  pathogen = "",
  indicator = "",
  age = "",
  countries = "",
  date_breaks = "1 month",
  date_format = "%b %Y",
  use_snapshot = FALSE,
  snapshot_date = NULL
)

Arguments

csv_file

Path to a local CSV file or URL containing the ERVISS data. If NULL (default), data is fetched from the official ERVISS repository.

date_min

Start date of the period (Date object)

date_max

End date of the period (Date object)

pathogen

Character vector of pathogen names to filter. Use "" (default) to include all pathogens.

indicator

Character vector of indicators to filter: "deaths", "hospitaladmissions", "ICUadmissions", "ICUinpatients", "hospitalinpatients", or any combination. Use "" (default) to include all indicators.

age

Character vector of age groups to filter (e.g., "0-4", "5-14", "15-64", "65+", "total"). Use "" (default) to include all age groups.

countries

Character vector of country names to filter. Use "" (default) to include all countries.

date_breaks

A string specifying the date breaks for the x-axis (e.g., "1 month", "2 weeks")

date_format

A string specifying the date format for x-axis labels (e.g., "%b %Y" for "Jan 2024")

use_snapshot

Logical. If TRUE, fetches a historical snapshot; if FALSE (default), fetches the latest data. Ignored if csv_file is provided.

snapshot_date

Date of the snapshot to retrieve. Required if use_snapshot = TRUE and csv_file is NULL.

Value

A ggplot2 object showing severity data over time by country and pathogen

Examples


# Quick visualization of hospital admissions
quick_plot_nonsentinel_severity(
  date_min = as.Date("2024-01-01"),
  date_max = as.Date("2024-12-31"),
  pathogen = "SARS-CoV-2",
  indicator = "hospitaladmissions",
  date_breaks = "1 month"
)


Quick plot of ERVISS non-sentinel tests/detections data

Description

Convenience function that fetches and plots ERVISS non-sentinel tests/detections data in one step. For more control, use get_nonsentinel_tests followed by plot_nonsentinel_tests.

Usage

quick_plot_nonsentinel_tests(
  csv_file = NULL,
  date_min,
  date_max,
  pathogen = "",
  indicator = "",
  age = "",
  countries = "",
  date_breaks = "1 month",
  date_format = "%b %Y",
  use_snapshot = FALSE,
  snapshot_date = NULL
)

Arguments

csv_file

Path to a local CSV file or URL containing the ERVISS data. If NULL (default), data is fetched from the official ERVISS repository.

date_min

Start date of the period (Date object)

date_max

End date of the period (Date object)

pathogen

Character vector of pathogen names to filter. Use "" (default) to include all pathogens.

indicator

Character vector of indicators to filter: "detections", "tests", or both. Use "" (default) to include all indicators.

age

Character vector of age groups to filter (e.g., "total"). Use "" (default) to include all age groups.

countries

Character vector of country names to filter. Use "" (default) to include all countries.

date_breaks

A string specifying the date breaks for the x-axis (e.g., "1 month", "2 weeks")

date_format

A string specifying the date format for x-axis labels (e.g., "%b %Y" for "Jan 2024")

use_snapshot

Logical. If TRUE, fetches a historical snapshot; if FALSE (default), fetches the latest data. Ignored if csv_file is provided.

snapshot_date

Date of the snapshot to retrieve. Required if use_snapshot = TRUE and csv_file is NULL.

Value

A ggplot2 object showing non-sentinel tests/detections over time by country and pathogen

Examples


# Quick visualization of non-sentinel detections
quick_plot_nonsentinel_tests(
  date_min = as.Date("2024-01-01"),
  date_max = as.Date("2024-12-31"),
  pathogen = "Influenza",
  indicator = "detections",
  date_breaks = "1 month"
)


Quick plot of ERVISS SARI positivity data

Description

Convenience function that fetches and plots ERVISS SARI positivity data in one step. For more control, use get_sari_positivity followed by plot_sari_positivity.

Usage

quick_plot_sari_positivity(
  csv_file = NULL,
  date_min,
  date_max,
  pathogen = "",
  indicator = "",
  age = "",
  countries = "",
  date_breaks = "2 weeks",
  date_format = "%b %Y",
  use_snapshot = FALSE,
  snapshot_date = NULL
)

Arguments

csv_file

Path to a local CSV file or URL containing the ERVISS data. If NULL (default), data is fetched from the official ERVISS repository.

date_min

Start date of the period (Date object)

date_max

End date of the period (Date object)

pathogen

Character vector of pathogen names to filter. Use "" (default) to include all pathogens.

indicator

Character vector of indicators to filter: "positivity", "detections", "tests", or any combination. Use "" (default) to include all indicators.

age

Character vector of age groups to filter (e.g., "total", "0-4", "5-14", "15-64", "65+"). Use "" (default) to include all age groups.

countries

Character vector of country names to filter. Use "" (default) to include all countries.

date_breaks

A string specifying the date breaks for the x-axis (e.g., "1 month", "2 weeks")

date_format

A string specifying the date format for x-axis labels (e.g., "%b %Y" for "Jan 2024")

use_snapshot

Logical. If TRUE, fetches a historical snapshot; if FALSE (default), fetches the latest data. Ignored if csv_file is provided.

snapshot_date

Date of the snapshot to retrieve. Required if use_snapshot = TRUE and csv_file is NULL.

Value

A ggplot2 object showing SARI positivity over time by country and pathogen

Examples


# Quick visualization of SARI positivity
quick_plot_sari_positivity(
  date_min = as.Date("2024-01-01"),
  date_max = as.Date("2024-12-31"),
  pathogen = "Influenza",
  indicator = "positivity",
  date_breaks = "1 month"
)


Quick plot of ERVISS SARI rates data

Description

Convenience function that fetches and plots ERVISS SARI rates data in one step. For more control, use get_sari_rates followed by plot_sari_rates.

Usage

quick_plot_sari_rates(
  csv_file = NULL,
  date_min,
  date_max,
  age = "",
  countries = "",
  date_breaks = "2 weeks",
  date_format = "%b %Y",
  use_snapshot = FALSE,
  snapshot_date = NULL
)

Arguments

csv_file

Path to a local CSV file or URL containing the ERVISS data. If NULL (default), data is fetched from the official ERVISS repository.

date_min

Start date of the period (Date object)

date_max

End date of the period (Date object)

age

Character vector of age groups to filter (e.g., "0-4", "5-14", "15-64", "65+", "total"). Use "" (default) to include all age groups.

countries

Character vector of country names to filter. Use "" (default) to include all countries.

date_breaks

A string specifying the date breaks for the x-axis (e.g., "1 month", "2 weeks")

date_format

A string specifying the date format for x-axis labels (e.g., "%b %Y" for "Jan 2024")

use_snapshot

Logical. If TRUE, fetches a historical snapshot; if FALSE (default), fetches the latest data. Ignored if csv_file is provided.

snapshot_date

Date of the snapshot to retrieve. Required if use_snapshot = TRUE and csv_file is NULL.

Value

A ggplot2 object showing SARI rates over time by country and age group

Examples


# Quick visualization of SARI rates
quick_plot_sari_rates(
  date_min = as.Date("2025-01-01"),
  date_max = as.Date("2025-12-31"),
  countries = "Spain",
  date_breaks = "1 month"
)