0

I am getting the following JSON output from R code:-

{
 "output": [ "{1} => {2}", "{1} => {3}", "{1} => {5}" ] 
}

I need to format the output to:-

{
 "output": [ "2","3","5" ] 
}

Is there anyway in R to get the desired output?

Harsha Nagraj
  • 61
  • 1
  • 9
  • 2
    What input are you using? How are you converting your date to JSON? (There is more than one package for converting to JSON). Currently your question is very difficult to answer. – Jan van der Laan Sep 10 '14 at 12:19
  • Input is JSON:-{"request":"1"} I am using RJSONIO package to parse through the input JSON and I am using toJSON() method for converting data to JSON. – Harsha Nagraj Sep 11 '14 at 03:39
  • I meant the input to your `toJSON` call. I assums you do something like `toJSON(somedata)`. Add the output of `dput(somedata)` to your question. Also add any arguments you use in your `toJSON` call. For more information on creating a good reproducible see: http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example – Jan van der Laan Sep 11 '14 at 10:00

0 Answers0