StatisticsGreenland / pxmake

pxmake: Read and write px files in R.
https://statisticsgreenland.github.io/pxmake/
Other
6 stars 3 forks source link

px_languages() %>% px_language() removes languages from language dependant tables #297

Open johan-ejstrud opened 3 months ago

johan-ejstrud commented 3 months ago
library(pxmake)
library(tidyverse)

x_before <-
  population_gl %>% 
  px() %>% 
  px_languages(c("en", "da", "kl"))

x_after <- px_language(x_before, "en")

# All languages are still defined
px_languages(x_after)

# But 'da' and 'kl has been removed table2, variables2, and cells2
x_before %>% purrr::pluck("table2")
x_after %>% purrr::pluck("table2")