Process variable of interest from Pandemic PACT website data by a grouping variable
Source:R/pact_process.R
pact_process.Rd
Process variable of interest from Pandemic PACT website data by a grouping variable
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 ofoutcome
based on thetopic
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")
} # }