Closed PietrH closed 8 months ago
Currently we have a few multivalue in the API output, we still need to handle these more elegantly before we can output to a tibble.
Currently we have exploredtibble::enframe(), and tidyr::pivot_wider()
tibble::enframe()
res %>% httr::content() %>% purrr::pluck("returndata") %>% head(5) %>% purrr::map(~purrr::pluck(.x, "data")) %>% # purrr::map(~purrr::map_dfc(.x, function(element){element})) purrr::map(~tibble::enframe(.x)) %>% purrr::map_dfr(~ tidyr::pivot_wider(.x, names_from = name))
But I personally think it should probably be handled with a combination of purrr::map_dfc and purrr::map_dfr
Currently we have a few multivalue in the API output, we still need to handle these more elegantly before we can output to a tibble.
Currently we have explored
tibble::enframe()
, and tidyr::pivot_wider()But I personally think it should probably be handled with a combination of purrr::map_dfc and purrr::map_dfr