Title: | Download Charitable Grants from the '360Giving' Platform |
---|---|
Description: | Access open data from <https://www.threesixtygiving.org>, a database of charitable grant giving in the UK operated by '360Giving'. The package provides functions to search and retrieve data on charitable grant giving, and process that data into tidy formats. It relies on the '360Giving' data standard, described at <https://standard.threesixtygiving.org/>. |
Authors: | Evan Odell [aut, cre] |
Maintainer: | Evan Odell <[email protected]> |
License: | GPL-3 |
Version: | 0.2.2 |
Built: | 2025-03-01 03:21:14 UTC |
Source: | https://github.com/evanodell/threesixtygiving |
360Giving is a data standard for publishing information about
charitable grant giving in the UK. threesixtygiving
provides functions to
retrieve and process charitable grant funding data from 360Giving.
See the 360 Giving website for more information on the source of this data, and the 360Giving Standard page for details of the data standard this package relies on.
Returns a list of data frames with details of all grants from funders
returned by tsg_available()
.
tsg_all_grants(verbose = TRUE, timeout = 30, retries = 0, correct_names = TRUE)
tsg_all_grants(verbose = TRUE, timeout = 30, retries = 0, correct_names = TRUE)
verbose |
If |
timeout |
The maximum request time, in seconds. If data is not returned
in this time, a value of |
retries |
The number of retries to make if a request is not successful. Defaults to 0. |
correct_names |
If |
Due to the structure of the 360 Giving data, the package will make
multiple attempts to request data. This can cause issues with servers
automatically blocking requests. You can use tsg_missing()
to identify
missing sets of grant data.
A list of tibbles with grant data.
## Not run: all_grants <- tsg_all_grants() ## End(Not run)
## Not run: all_grants <- tsg_all_grants() ## End(Not run)
Returns a tibble with information on all datasets available through 360Giving. Some funders have multiple datasets
tsg_available()
tsg_available()
A tibble with details on all available datasets.
## Not run: available <- tsg_available() ## End(Not run)
## Not run: available <- tsg_available() ## End(Not run)
Given a list returned by tsg_all_grants()
or tsg_search_grants()
, creates
a tibble with the core variables required by the
360Giving open standard,
as well as the publisher prefix and dataset identifier,
which are useful for data processing, and the licence the data was
published under.
tsg_core_data(x, verbose = TRUE)
tsg_core_data(x, verbose = TRUE)
x |
A list of tibble with grant data returned by |
verbose |
If |
A tibble with the core variables in the 360Giving standard.
tsg_process_data()
, which does the same processing but returns
all available variables.
## Not run: grants <- tsg_all_grants() df <- tsg_core_data(grants) ## End(Not run)
## Not run: grants <- tsg_all_grants() df <- tsg_core_data(grants) ## End(Not run)
Returns a tibble with details on any available data missing from a list
of grants returned by tsg_all_grants()
.
tsg_missing(x)
tsg_missing(x)
x |
A list of tibble with grant data returned by |
A tibble with details on funders missing data from a list of tibbles passed to the function.
## Not run: all_grants <- tsg_all_grants() missing_grants <- tsg_missing(all_grants) ## End(Not run)
## Not run: all_grants <- tsg_all_grants() missing_grants <- tsg_missing(all_grants) ## End(Not run)
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.
tsg_process_data(x, min_coverage = 0, verbose = TRUE)
tsg_process_data(x, min_coverage = 0, verbose = TRUE)
x |
A list of tibble with grant data returned by |
min_coverage |
A number from 0 to 1. If >0, only returns variables
with a value other than |
verbose |
If |
A tibble with all variables from all provided grants.
tsg_core_data()
, which does the same processing but only returns
the core variables in the 360Giving standard.
## 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)
## 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)
Return a tibble with information on all grant datasets where funder data matches one or more search strings.
tsg_search_funders( search, search_in = NULL, verbose = TRUE, ignore_case = TRUE, perl = FALSE, fixed = FALSE )
tsg_search_funders( search, search_in = NULL, verbose = TRUE, ignore_case = TRUE, perl = FALSE, fixed = FALSE )
search |
The string(s) to search for. By default allows POSIX 1003.2
regular expressions. Use |
search_in |
The name of the column to search in. Accepts single strings
or a character vector of column names. If |
verbose |
If |
ignore_case |
If |
perl |
If |
fixed |
If |
A tibble with information on matching datasets
tsg_search_grants()
for retrieving all grants
from matching funders.
## Not run: search1 <- tsg_search_funders(search = c("bbc", "caBinet")) ## End(Not run)
## Not run: search1 <- tsg_search_funders(search = c("bbc", "caBinet")) ## End(Not run)
Returns a list of tibbles with details of all grants from specific funders.
tsg_search_grants( search, search_in = NULL, verbose = TRUE, ignore_case = TRUE, perl = FALSE, fixed = FALSE, ... )
tsg_search_grants( search, search_in = NULL, verbose = TRUE, ignore_case = TRUE, perl = FALSE, fixed = FALSE, ... )
search |
The string(s) to search for. By default allows POSIX 1003.2
regular expressions. Use |
search_in |
The name of the column to search in. Accepts single strings
or a character vector of column names. If |
verbose |
If |
ignore_case |
If |
perl |
If |
fixed |
If |
... |
Additional params passed to |
tsg_search_grants
retrieves grants where funder data
matches one or more search strings. If only one dataset
matches queries, returns a tibble of that dataset.
Use tsg_specific_df()
to pass a dataframe.
A single tibble (if only one grant maker matches the queries) or a list of tibbles (if the query matches multiple datasets).
tsg_search_funders()
for retrieving information on available
datasets from matching funders. tsg_specific_df()
to retrieve data
contained with all or specific rows of a tibble returned
by tsg_available()
or tsg_missing()
.
## Not run: specific1 <- tsg_search_grants(search = c("bbc", "caBinet")) ## End(Not run)
## Not run: specific1 <- tsg_search_grants(search = c("bbc", "caBinet")) ## End(Not run)
Retrieve data contained with all or specific rows of a tibble
returned by tsg_available()
or tsg_missing()
.
tsg_specific_df(x, verbose = TRUE, timeout = 30, retries = 0)
tsg_specific_df(x, verbose = TRUE, timeout = 30, retries = 0)
x |
All or a subset of a tibble returned by
|
verbose |
If |
timeout |
The maximum request time, in seconds. If data is not returned
in this time, a value of |
retries |
The number of retries to make if a request is not successful. Defaults to 0. |
A list of tibbles with grant data.
## Not run: all_grants <- tsg_all_grants() missing_grants <- tsg_missing(all_grants) more_grants <- tsg_specific_df(missing_grants) ## End(Not run)
## Not run: all_grants <- tsg_all_grants() missing_grants <- tsg_missing(all_grants) more_grants <- tsg_specific_df(missing_grants) ## End(Not run)