I am sending a json array by POST to an R script. The array looks like this:
POST$samples=
{"DIW blank":["23.36"],
"DA-f 1000 20081118":["6.31"],
"1294 RM DA Biosense Nov 2008":["6.28"],
"1334 RM DA Biosense Nov 2008":["6.28","22.84"],
"1422 RM DA Biosense Nov 2008":["6.29"]
}
When I convert that from json in R, I get this list:
$`DIW blank`
[1] "23.36"
$`DA-f 1000 20081118`
[1] "6.31"
$`1294 RM DA Biosense Nov 2008`
[1] "6.28"
$`1334 RM DA Biosense Nov 2008`
[1] "6.28" "22.84"
$`1422 RM DA Biosense Nov 2008`
[1] "6.29"
What I’d like is for all the number vectors to actually be numbers. Do I have to foreach through the list with as.numeric, or is there an easier way?
This is the one line bit of code that joran was (perhaps) thinking about: