Skip to content

Processing Functions

FMDData.add_all_metadata! Method
julia
add_all_metadata!(
    df_pair::Pair{T, D}
) where {T <: DataFrame, D <: OrderedDict{<:Symbol, <:Any}}

Adds multiple metadata columns to a DataFrame based on a dictionary of metadata.

Arguments

  • df_pair: A Pair where the key is the DataFrame to modify and the value is an OrderedDict of metadata. The keys of the dictionary should be the names of the metadata columns to add, and the values should be the values to populate those columns with.
source
FMDData.add_metadata_col! Method
julia
add_metadata_col!(metadata_column, df_metadata_pairs...)

Adds a metadata column to one or more DataFrames. This is a generic function that can be used to add any metadata column.

source
FMDData.add_metadata_col! Method
julia
add_metadata_col!(
    metadata_column::Symbol,
    df_metadata_pair::Pair{T, I},
) where {T <: AbstractDataFrame, I <: Union{<:Integer, <:AbstractFloat, <:AbstractString}}

Adds a metadata column to a single DataFrame.

source
FMDData.add_report_year! Method
julia
add_report_year!(
    df_year_pairs::Pair{T, I}...;
    year_column = :report_year
) where {T <: AbstractDataFrame, I <: Integer}

Adds a report year column to one or more DataFrames.

source
FMDData.add_round_name! Method
julia
add_round_name!(
    df_round_pairs::Pair{T, S}...;
    round_column = :round
) where {T <: AbstractDataFrame, S <: AbstractString}

Adds a round name column to one or more DataFrames.

source
FMDData.add_sample_year! Method
julia
add_sample_year!(
    df_year_pairs...;
    year_column = :sample_year
)

Adds a sample year column to one or more DataFrames.

source
FMDData.add_test_threshold! Method
julia
add_test_threshold!(
    df_round_pairs::Pair{T, S}...;
    threshold_column = :test_threshold
) where {T <: AbstractDataFrame, S <: AbstractString}

Adds a test threshold column to one or more DataFrames.

source
FMDData.add_test_type! Method
julia
add_test_type!(
    df_round_pairs::Pair{T, S}...;
    test_column = :test_type
) where {T <: AbstractDataFrame, S <: AbstractString}

Adds a test type column to one or more DataFrames.

source
FMDData.combine_round_dfs Method
julia
combine_round_dfs(dfs::DataFrame...)

Combines multiple DataFrames into a single DataFrame.

source
FMDData.infer_later_year_values Method
julia
infer_later_year_values(
    cumulative_later_df::T,
    initial_df::T;
    year_column = :sample_year,
    statename_column = :states_ut,
    allowed_serotypes = vcat("all", default_allowed_serotypes),
    reg::Regex,
    atol = 0.0,
    digits = 1

) where {T <: AbstractDataFrame}

Infers the values for a later year by subtracting the values from an initial year from a cumulative dataset. This is useful when a report provides cumulative data, and you need to extract the data for a single year.

source