Function jsonlite::fromJSON reads strings into R objects. Found cases where it has unnatural type-inference. The string was read into a list of list of data.frame objects. While the innermost layer consisting of data.frame has consistent column names and types, there is a column of decimal numbers that have been, for certain cases, read as character vector, and other cases, numeric vector. They gave an error when I tried purrr::pmap coupled with tidyr::unnest, and therefore I had to manually write a for-loop to perform type-casting first. Writing here with hopes that jsonlite and tidyverse can get better integrated.
Hi, welcome!
I think you would have better luck with this by filing an issue in the package´s GitHub page and including a minimal REPRoducible EXample (reprex)
This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.