threesixtygiving

threesixtygiving

https://github.com/evanodell/threesixtygiving

Science Score: 23.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
  • .zenodo.json file
  • DOI references
    Found 4 DOI reference(s) in README
  • Academic publication links
    Links to: zenodo.org
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (15.5%) to scientific vocabulary

Keywords

charities data-retrieval philanthropy r r-package
Last synced: 6 months ago · JSON representation

Repository

threesixtygiving

Basic Info
  • Host: GitHub
  • Owner: evanodell
  • License: gpl-3.0
  • Language: R
  • Default Branch: master
  • Size: 1.08 MB
Statistics
  • Stars: 2
  • Watchers: 0
  • Forks: 0
  • Open Issues: 0
  • Releases: 0
Topics
charities data-retrieval philanthropy r r-package
Created over 6 years ago · Last pushed about 5 years ago

https://github.com/evanodell/threesixtygiving/blob/master/




[![License: GPL
v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)
[![CRAN\_Status\_Badge](https://www.r-pkg.org/badges/version/threesixtygiving)](https://cran.r-project.org/package=threesixtygiving)
[![GitHub
tag](https://img.shields.io/github/tag/evanodell/threesixtygiving.svg)](https://github.com/evanodell/threesixtygiving)
[![](https://cranlogs.r-pkg.org/badges/grand-total/threesixtygiving)](https://dgrtwo.shinyapps.io/cranview/)
[![R build
status](https://github.com/evanodell/threesixtygiving/workflows/R-CMD-check/badge.svg)](https://github.com/evanodell/threesixtygiving/actions)
[![Codecov test
coverage](https://codecov.io/gh/evanodell/threesixtygiving/branch/master/graph/badge.svg)](https://codecov.io/gh/evanodell/threesixtygiving?branch=master)
[![AppVeyor build
status](https://ci.appveyor.com/api/projects/status/github/evanodell/threesixtygiving?branch=master&svg=true)](https://ci.appveyor.com/project/evanodell/threesixtygiving)
[![DOI](https://zenodo.org/badge/195080045.svg)](https://zenodo.org/badge/latestdoi/195080045)


# threesixtygiving

Access open data from [360Giving](https://www.threesixtygiving.org/)
publishers. 360Giving is a data standard for publishing information
about charitable grant giving in the UK. 360Giving maintains a [registry
of grant makers](https://data.threesixtygiving.org/) using the standard.
The package provides functions to search and retrieve data on charitable
giving.

## Installation



You can install the development version from
[GitHub](https://github.com/evanodell/threesixtygiving) with:

``` r
# install.packages("devtools")
devtools::install_github("evanodell/threesixtygiving")
```

## Purpose

The `threesixtygiving` package provides tools for programmatically
downloading and analysing grants made by charitable trusts using the
[360Giving standard](https://standard.threesixtygiving.org/). These
include functions to search available datasets, retrieve data and
process it to tidy formats.

## Usage

The example below shows how to retrieve all available grants, and
presents the total value of grants since 2018-01-01. It uses the
[`fixerapi`](https://cran.r-project.org/package=fixerapi) package to
perform currency conversions, as some grants are reported in currencies
other than GBP.

``` r
library(threesixtygiving)
library(dplyr)
library(ggplot2)
library(fixerapi) # for currency rates
library(stringi)

grants <- tsg_all_grants(timeout = 8, retries = 0)

df <- tsg_core_data(grants)

# Retrieve currency exchange rates
currencies <- fixer_latest("EUR", c(unique(df$currency)))

# Convert exchange rates to use GBP as the base currencies
currencies <- currencies %>% 
  mutate(value = value * (1/currencies$value[currencies$name == "GBP"]))

currencies

## rate on 2020-11-28
df2 <- df %>% 
  mutate(amount_awarded = case_when(
    currency == "USD" ~ amount_awarded/filter(currencies, name=="USD")$value,
    currency == "CAD" ~ amount_awarded/filter(currencies, name=="CAD")$value,
    currency == "CHF" ~ amount_awarded/filter(currencies, name=="CHF")$value,
    currency == "EUR" ~ amount_awarded/filter(currencies, name=="EUR")$value,
    currency == "ILS" ~ amount_awarded/filter(currencies, name=="ILS")$value,
    TRUE ~ amount_awarded)) %>%
  filter(award_date >= "2018-01-01") %>%
  group_by(funding_org_name) %>%
  summarise(n = n(),
            amount_awarded = sum(amount_awarded)) %>%
  mutate(avg = amount_awarded/n)

theme_set(theme_bw())

p1 <- ggplot(df2 %>% 
               top_n(20, amount_awarded) %>% 
               mutate(amount_awarded2 = amount_awarded/100000),
             aes(x = reorder(funding_org_name, -amount_awarded2),
                 y = amount_awarded2, fill = amount_awarded2)) + 
  geom_col() + 
  scale_y_sqrt(labels = scales::dollar_format(prefix = ""),
               breaks = c(1000, 5000, 10000, 25000, 50000, 75000)) + 
  scale_x_discrete(labels = scales::wrap_format(40)) + 
  scale_fill_viridis_c() + 
  labs(x = "Funder", y = "Amount Awarded 
       (in 100,000s, note logarithmic scale)",
       title = "Total Value of Grants Awarded by Twenty Largest Funders",
       caption = "(c) Evan Odell | 2020 | CC-BY-SA | Data from 360Giving") + 
  theme(axis.text.x = element_text(angle = 45, hjust = 1, size = 7),
        legend.position = "none") 
  
p1

#ggsave("man/figures/total-value.png", p1, width = 10)
```

![](man/figures/total-value.png)

## Notes

This project is possible thanks to support and encouragement from David
Kane at [360Giving](https://www.threesixtygiving.org/), and from
[Disability Rights UK](https://www.disabilityrightsuk.org/).

### Data licences

The actual grant data is available under a variety of open licences,
typically a version of the Open Government Licence or one of the
Creative Commons licences. Please respect the licence conditions that
are attached to each dataset.

### Citing `threesixtygiving`

Please cite `threesixtygiving` as:

Odell, Evan (2020). *threesixtygiving: Download Charitable Grants from
the 360Giving Platform*. doi:
[10.5281/zenodo.3474128](https://doi.org/10.5281/zenodo.3474128), R
package version 0.2.2, URL:
.

A BibTeX entry for LaTeX users is:

      @Manual{,
        title = {threesixtygiving: Download Charitable Grants from the '360Giving' Platform},
        author = {Evan Odell},
        year = {2020},
        doi = {10.5281/zenodo.3474128},
        url = {https://docs.evanodell.com/threesixtygiving},
        note = {R package version 0.2.2},
      }

### Code of Conduct

Please note that the `threesixtygiving` package is released with a
[Contributor Code of
Conduct](https://github.com/evanodell/threesixtygiving/blob/master/CODE_OF_CONDUCT.md).
By contributing to this project, you agree to abide by its terms.

The code in this package is licensed using the [GNU General Public
License Version 3](https://www.gnu.org/licenses/gpl-3.0) software
license.

Owner

  • Name: Evan Odell
  • Login: evanodell
  • Kind: user
  • Location: Berlin

Data analysis | Statistics | R packages

GitHub Events

Total
Last Year

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 0
  • Total pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Total issue authors: 0
  • Total pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • cran 244 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 1
  • Total maintainers: 1
cran.r-project.org: threesixtygiving

Download Charitable Grants from the '360Giving' Platform

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 244 Last month
Rankings
Stargazers count: 28.5%
Forks count: 28.8%
Dependent packages count: 29.8%
Dependent repos count: 35.5%
Average: 41.2%
Downloads: 83.5%
Maintainers (1)
Last synced: 6 months ago

Dependencies

.github/workflows/R-CMD-check.yaml actions
  • actions/cache v2 composite
  • actions/checkout v2 composite
  • actions/upload-artifact main composite
  • r-lib/actions/setup-pandoc v1 composite
  • r-lib/actions/setup-r v1 composite
.github/workflows/test-coverage.yaml actions
  • actions/cache v2 composite
  • actions/checkout v2 composite
  • r-lib/actions/setup-pandoc v1 composite
  • r-lib/actions/setup-r v1 composite
DESCRIPTION cran
  • anytime * imports
  • curl * imports
  • dplyr * imports
  • httr * imports
  • janitor * imports
  • jsonlite * imports
  • purrr * imports
  • readr * imports
  • readxl * imports
  • tibble * imports
  • tidyr * imports
  • tidyselect * imports
  • covr * suggests
  • fixerapi * suggests
  • ggplot2 * suggests
  • ggrepel * suggests
  • knitr * suggests
  • rmarkdown * suggests
  • scales * suggests
  • stringi * suggests
  • testthat >= 2.1.0 suggests