Menu
Ready Signal API Documentation – R 3.6+
This library is designed to be a wrapper for the Ready Signal API: http://app.readysignal.com
It is hosted on GitHub here: https://github.com/rxa-io/readysignal-r
Please direct all questions and/or recommendations to [email protected]
Installation |
library(devtools) devtools::install_github(“rxa-io/readysignal-r”) |
Usage |
Your access token and signal ID can be found on your “Manage Signal” page within the Output information. Your signal ID is also visible within the URL of the “Manage Signal” page:https://…readysignal.com/signal/SIGNAL_ID /manage |
Setup |
library(readysignal) access_token <- “YOUR_ACCESS_TOKEN“ signal_id <- 123 # (your signal ID) |
List Signal |
Using your access_token , you can list all signals and metadata that are associated with your Ready Signal account.list_signals(access_token) |
Example Output |
id name description … links.manage 1 7 test signal first signal … https://app.readysignal.com/signal/7/manage 2 11 another signal useful signal … https://app.readysignal.com/signal/11/manage 3 13 one more signal important stuff … https://app.readysignal.com/signal/13/manage |
Signal Details |
Using your access_token and your signal_id you can view the details of a specific signal.get_signal_details(access_token, signal_id) |
Signal Data |
There are two different ways to receive your signal data: * R data.frame * CSV exportdata.framedf <- get_signal(access_token, signal_id) |
Example Output |
start end country actual-snow-fall … population-total 1 2019-11-01 2019-11-30 United States of America 160205.00 … 308745538.00 2 2019-12-01 2019-12-31 United States of America 219691.00 … 308745538.00 3 2020-01-01 2020-01-31 United States of America 220869.00 … 308745538.00 |
CSV Export |
signal_to_csv(access_token, signal_id, “my_signal.csv”) |
Help |
Use the built-in help() command to view function descriptions, etc. help(signal_to_csv) |
Auto Discover
Description |
create a signal with the Auto Discover feature |
Usage |
auto_discovery ( |
Arguments | |
token | User access token |
geo_grain | Geo grain of upload, “State” or “Country” |
date_grain |
|
create_custom_features |
|
filename | Filename of .CSV or .XLS with “Date”, “Value”, “State” (if geo_grain=State) columns. Not to be used with df |
df | Dataframe with “Date”, “Value”, “State” (if geo_grain=State). Not to be used with filename |
callback_url | Callback URL for notifications |
Value |
HTTP response |
Sample Code |
# create a new signal with the AutoDiscovery feature # from a dataframe. When geo-grain=Country, columns # MUST be c("Date", "Value"). When geo-grain=State, # columns MUST be c("Date", "Value", "State") df <- data.frame( Date=c("2022-01-01", "2022-01-02", "2022-01-03"), Value=c(351, 465, 712) ) auto_discover(token, geo_grain="Country", date_grain="Day", df=df) # use AutoDiscovery with a file upload, this time we'll # use a State geo_grain. The file needs the same columns # as described above system("cat states.csv") # Date,State,Value # 2020-03-01,TN,416000 # 2020-03-01,KY,373000 # ... resp <- auto_discover(token, geo_grain="State", date_grain="Month", filename="states.csv") |