# 1. unzip a local zip file
# 2. parquetize it
file_path <- download_extract(system.file("extdata","mtcars.csv.zip", package = "readr"))
csv_to_parquet(
file_path,
path_to_parquet = tempfile(fileext = ".parquet")
)
# 1. download a remote file
# 2. extract the file census2021-ts007-ctry.csv
# 3. parquetize it
file_path <- download_extract(
"https://www.nomisweb.co.uk/output/census/2021/census2021-ts007.zip",
filename_in_zip = "census2021-ts007-ctry.csv"
)
csv_to_parquet(
file_path,
path_to_parquet = tempfile(fileext = ".parquet")
)
# the file is local and not zipped so :
# 1. parquetize it
file_path <- download_extract(parquetize_example("region_2022.csv"))
csv_to_parquet(
file_path,
path_to_parquet = tempfile(fileext = ".parquet")
)
Run the code above in your browser using DataLab