tsg_process_data: Convert data to tibble

Description Usage Arguments Value See Also Examples

View source: R/process-data.R

Description

Given a list returned by tsg_all_grants() or tsg_search_grants(), creates a tibble with all available variables. This tibble contains roughly 200 columns if all available grants are used (as of October 2019), due to differences in how grant data is labelled and structured.

Usage

1
tsg_process_data(x, min_coverage = 0, verbose = TRUE)

Arguments

x

A list of tibble with grant data returned by tsg_all_grants().

min_coverage

A number from 0 to 1. If >0, only returns variables with a value other than NA for at least that proportion of rows. Defaults to 0 and returns all columns.

verbose

If TRUE, prints console messages on data retrieval progress. Defaults to TRUE.

Value

A tibble with all variables from all provided grants.

See Also

tsg_core_data(), which does the same processing but only returns the core variables in the 360Giving standard.

Examples

1
2
3
4
5
6
7
8
9
## Not run: 
grants <- tsg_all_grants()

df1 <- tsg_process_data(grants)

# Only return data from columns with more than 50% coverage
df2 <- tsg_process_data(grants, min_coverage = 0.5)

## End(Not run)

evanodell/threesixtygiving documentation built on Dec. 1, 2020, 11:29 p.m.