tags:

views:

44

answers:

1

Then I read JSON files from R using rjson it seems that JSON arrays (enclosed with []) are converted to (unnamed) R lists, not vectors.

Therefore I have to first unlist(recuresice=F) each of those lists before I can work with them.

  1. Is there any logic behind this conversion I am missing? I mean, why use a list (and not a vector) to store an array?
  2. Is there any way to control this behavior of rjson (or perhaps another recommended JSON parser for R)?
+2  A: 

JSON arrays can store values of different types, so they are equivalent to R unnamed lists.

mbq
+1 ah... that makes sense. thanks!
David B