Closed momeara closed 8 years ago
This is a bug in tidyr
. List columns can contain NULL
values and tidyr seems to choke on that:
data <- data.frame(x = 1:2)
data$y <- list(NULL, c("foo", "bar"))
tidyr::unnest(data, y)
It's actually a dplyr bug: https://github.com/hadley/dplyr/issues/1605
I am trying to read JSON data into R that is an array of rows having a list column that has missing values.1 For example,
I can use the
jsonlite
to parse the data,However,
col2
has aNULL
value in it rather than aNA
as I would have expected.The
NULL
value is a problem, because when trying to unpackcol2
usingtidyr
it results in a segmentation fault. I think
fromJSON
should have anNA
value rather thanNULL
value here, because then it's possible to use element-wise functions on the columns. But, none-the-less, I don't thinktidyr
should seg-fault when presented withNULL
s.I've cross posted this bug to
jsonlite
, jeroenooms/jsonlite#1201E.g. the uniprot_ids column from genenames.org has missing values for some genes.