The RSysrev client can be used to create projects on sysrev.com and upload json documents for review. In this project, we use RSysrev to create a review of NIH opioid crisis small business grants. View the final product at sysrev.com/p/36134.
Start by installing
RSysrev version 0.1:
Get a sysrev token
To use RSysrev a pro plan on sysrev.com and a token is needed. After signing up for an individual pro plan get an api token with RSysrev:
Never share a sysrev token or save them where others might see it. Some bad guys use automated scrapers to search for tokens on sites like github.com.
We recommend storing your token in an environmental variable and loading it in your notebooks with something like
.token <- Sys.getenv("srtoken").
Create a dataset
With a token ready, a dataset can easily be created:
Log into datasource.insilica.co with your sysrev credentials to find your dataset.
Hooray! We now have a dataset where we can store documents. It can also be imported into sysrev.com projects.
Store documents in a dataset
You can upload R dataframes directly to your dataset. We start with the below spreadsheet downloaded from NIH Reporter.
To upload this dataframe to our dataset we:
RSysrev::datasource.importDataframe imports each row from a data frame as a json entity. After running this function our grant data set now has 305 entities, where each entity is a json object.
Note that we chose the grant
Project Title as an external identifier, this makes it easy to join datasets with other data that have a shared identifier, entities should have a unique external.id. We provided a
filename for each entity, which is more relevant when uploading text files, or other file based entities, but should also be unique.
The uploaded entities are visible on datasource.insilica.co:
Import a dataset into sysrev
It is easy to import datasets into any sysrev you own:
All of these grants are now visible on sysrev.com/p/36134/articles. For example:
With these steps, it is possible to set up a review of any text or json type entities you are interested in.