Skip to content

Instantly share code, notes, and snippets.

@randyzwitch
Created May 13, 2014 16:45
Show Gist options
  • Save randyzwitch/e9813740389df976c5a8 to your computer and use it in GitHub Desktop.
Save randyzwitch/e9813740389df976c5a8 to your computer and use it in GitHub Desktop.
Inefficient way to build JSON in R
#Converts report_suites to JSON
if(length(report_suites)>1){
report_suites <- toJSON(report_suites)
} else {
report_suites <- toJSON(list(report_suites))
}
#API request
json <- postRequest("ReportSuite.GetTrafficVars",paste('{"rsid_list":', report_suites , '}'))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment