# Download example files from the package's GitLab page
package_gitlab_site <- 'https://gitlab.com/Puletti/agebanddecomposition_rpackage'
rwl_url <- "/-/raw/main/studio/dati/TRW_example.rwl"
po_url <- "/-/raw/main/studio/dati/pith.offset.txt"
# Create temporary files
tmpfile_rwl <- tempfile(fileext = ".rwl")
tmpfile_po <- tempfile(fileext = ".txt")
# Download the files
download.file(paste0(package_gitlab_site, rwl_url),
tmpfile_rwl,
mode = "wb")
download.file(paste0(package_gitlab_site, po_url),
tmpfile_po,
mode = "wb")
# Import the data
inData <- import_rwl(rwl_path = tmpfile_rwl,
po_path = tmpfile_po,
ageBands = '1010',
first_age_class = 3,
zero_as_na = TRUE,
verbose = TRUE)
# View the result
inData
Run the code above in your browser using DataLab