I’m having in a function that iterates through several jsons some code like below:
my_tibble <- tibble(col_a = json$xyz$xyz,
col_b = json$xyz2$xyz2,
col_c = json$xyz3,
...)
I would like to have a NA
returned if for instance col_b
is missing in the json so here json$xyz2$xyz2
.
Right now it just throw an error :
Error: Column "col_b" must be length 1 or 36, not 0