Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/christopherkenny/planscorer
https://github.com/christopherkenny/planscorer
Last synced: 28 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/christopherkenny/planscorer
- Owner: christopherkenny
- License: other
- Created: 2022-11-23T04:39:30.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-09-25T14:33:56.000Z (about 1 month ago)
- Last Synced: 2024-09-26T01:39:51.372Z (about 1 month ago)
- Language: R
- Homepage: http://christophertkenny.com/planscorer/
- Size: 6.23 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.Rmd
- License: LICENSE
Awesome Lists containing this project
README
---
output: github_document
---```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = '#>',
fig.path = 'man/figures/README-',
out.width = '100%'
)
```[![R-CMD-check](https://github.com/christopherkenny/planscorer/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/christopherkenny/planscorer/actions/workflows/R-CMD-check.yaml)
`planscorer` offers an R interface to PlanScore.org's API.
## Installation
You can install the development version of planscorer from [GitHub](https://github.com/) with:
``` r
# install.packages('remotes')
remotes::install_github('christopherkenny/planscorer')
```## Authentication
To use planscorer, you must have an API key from PlanScore. Otherwise, you will get a 403 forbidden error.
To get a key, follow the [instructions here](https://github.com/PlanScore/PlanScore/blob/main/API.md).
Once you have a key, use `ps_set_key('your_key')`. Optionally use `ps_set_key('your_key', install = TRUE)` to allow your key to be available across sessions.
## Example
With a file, you can upload using the `ps_upload_file()` option:
```{r example}
library(planscorer)
## basic example codefile <- system.file('extdata/null-plan-incumbency.geojson', package = 'planscorer')
links <- ps_upload_file(file)
``````{r, echo=FALSE}
Sys.sleep(20)
```To read the data results:
```{r}
ps_ingest(links)
```To capture the outputted figures on the site:
```{r}
img <- 'man/figures/README-planscore.png'
ps_capture(links, img)knitr::include_graphics(img)
```