write.socrata | R Documentation |
Method for updating Socrata datasets
write.socrata(
dataframe,
dataset_json_endpoint,
update_mode,
email,
password,
app_token = NULL
)
dataframe |
- dataframe to upload to Socrata |
dataset_json_endpoint |
- Socrata Open Data Application Program Interface (SODA) endpoint (JSON only for now) |
update_mode |
- "UPSERT" or "REPLACE"; consult https://dev.socrata.com/publishers/getting-started.html |
email |
- The email to the Socrata account with read access to the dataset |
password |
- The password associated with the email to the Socrata account |
app_token |
- a (non-required) string; SODA API token can be used to query the data portal https://dev.socrata.com/consumers/getting-started.html |
Mark Silverberg mark.silverberg@socrata.com
## Not run:
# Store user email and password
socrataEmail <- Sys.getenv("SOCRATA_EMAIL", "mark.silverberg+soda.demo@socrata.com")
socrataPassword <- Sys.getenv("SOCRATA_PASSWORD", "7vFDsGFDUG")
datasetToAddToUrl <- "https://soda.demo.socrata.com/resource/xh6g-yugi.json" # dataset
# Generate some data
x <- sample(-1000:1000, 1)
y <- sample(-1000:1000, 1)
df_in <- data.frame(x,y)
# Upload to Socrata
write.socrata(df_in,datasetToAddToUrl,"UPSERT",socrataEmail,socrataPassword)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.