Skip to contents

Process variable of interest from Pandemic PACT website data by a grouping variable

Usage

pact_process_topic_group(
  df,
  topic,
  group = NULL,
  outcome = c("frequency", "money")
)

pact_process_disease(df, group = NULL, outcome = c("frequency", "money"))

pact_process_category(df, group = NULL, outcome = c("frequency", "money"))

Arguments

df

A data.frame of the Pandemic PACT dataset from the Figshare repository.

topic

A character value of the variable name in df for the topic of interest.

group

A character value or vector of up to two values of the variable name/s in df to use as grouping variable/s. When specified as NULL (default), no grouping is applied to come up with value of outcome based on the topic of interest. When specified as NULL (default), no grouping is applied.

outcome

The type of outcome. Either "frequency" or "money". Default is "frequency".

Value

A data.frame structured based on specification. If group is NULL, the data.frame presents values for topic as first column and then either frequencies/counts of grants per topic value or sum of monetary amount of grants per topic. if group has one value, the data.frame presents values for group as first column followed by either frequencies/counts of grants per group or sum of monetary amount of grants per group then followed by the topics within each group followed by either frequencies/counts of grants per topic by group or sum of monetary amount of grants per topic by group.

Examples

if (FALSE) { # \dontrun{
  df <- pact_read_website()
  pact_process_topic_group(df, topic = "Disease")
} # }