Processing Functions
FMDData.add_all_metadata! Method
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
: APair
where the key is the DataFrame to modify and the value is anOrderedDict
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.
FMDData.add_metadata_col! Method
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.
sourceFMDData.add_metadata_col! Method
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.
sourceFMDData.add_report_year! Method
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.
sourceFMDData.add_round_name! Method
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.
sourceFMDData.add_sample_year! Method
add_sample_year!(
df_year_pairs...;
year_column = :sample_year
)
Adds a sample year column to one or more DataFrames.
sourceFMDData.add_test_threshold! Method
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.
sourceFMDData.add_test_type! Method
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.
sourceFMDData.combine_round_dfs Method
combine_round_dfs(dfs::DataFrame...)
Combines multiple DataFrames into a single DataFrame.
sourceFMDData.infer_later_year_values Method
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