r - How do I pass raw JSON strings to the DeployR WebAPI? -


scenario:

i have set of inputs need pass through deployr server. parameters simple strings others json strings converted r script calling fromjson.

problem

when pass simple string values server fine when try pass json formatted string server, script execution fails. script has been tested locally , using via r.net library works. unfortunately r.net not suite our use case need multi threading.

example:

var jsonstring = rdatafactory.createstring("jsondata", file.readalltext("data/jsondata.txt"));  taskoptions.rinputs.add(jsonstring);  //execute request .... 

where json data looks this

//jsondata.txt {"id":77674,"name":"my company","currencysymbol":"r"} 

and r call failing is

deployrinput('{ "name": "jsondata", "default": "", "render": "character" } ') mydata <- fromjson(jsondata) #everything disintegrates 

question:

how pass raw string json formatted rinput deployr server?

please forgive me if small, relatively new , couldn't find helpful in docs.

thanks in advance!

figured out. seems "rjson" package doesn't play nicely deployr.

using package "jsonlite" resolved issue.


Comments

Popular posts from this blog

sql - invalid in the select list because it is not contained in either an aggregate function -

Angularjs unit testing - ng-disabled not working when adding text to textarea -

How to start daemon on android by adb -