# Save px object to PX-file
tmp_dir <- tempdir()
x <- px(population_gl)
px_save(x, file.path(tmp_dir, "population.px"))
# Save px object to Excel workbook
px_save(x, file.path(tmp_dir, "population.xlsx"))
# Save px object as R-script that creates the px object
px_save(x, file.path(tmp_dir, "population.R"))
Run the code above in your browser using DataLab