You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
One can read a Data Package (read_package()) from a URL or download it first and then read it locally.
The current behaviour for writing a remotely read package is to not copy the files to disk, since they are already available online. However, that makes it more difficult to 1) download a whole Data Package using R and 2) update a Data Package (e.g. adding a resource), because the originally local paths are now URLs pointing to an online CSV, and that might not be the version you want to point to.
library(frictionless)
package<- read_package("https://zenodo.org/record/5070086/files/datapackage.json")
#> Please make sure you have the right to access data from this Data Package for your intended use.#> Follow applicable norms or requirements to credit the dataset and its authors.#> For more information, see https://doi.org/10.5281/zenodo.5070086# Paths are localpackage$resources[[2]]$path#> [1] "O_WESTERSCHELDE-gps-2018.csv" "O_WESTERSCHELDE-gps-2019.csv"#> [3] "O_WESTERSCHELDE-gps-2020.csv"
write_package(package, "my_directory")
list.files("my_directory")
#> [1] "datapackage.json"written_package<- read_package("my_directory/datapackage.json")
#> Please make sure you have the right to access data from this Data Package for your intended use.#> Follow applicable norms or requirements to credit the dataset and its authors.#> For more information, see https://doi.org/10.5281/zenodo.5070086# Paths are URLs nowwritten_package$resources[[2]]$path#> [1] "https://zenodo.org/record/5070086/files/O_WESTERSCHELDE-gps-2018.csv"#> [2] "https://zenodo.org/record/5070086/files/O_WESTERSCHELDE-gps-2019.csv"#> [3] "https://zenodo.org/record/5070086/files/O_WESTERSCHELDE-gps-2020.csv"
One can read a Data Package (
read_package()
) from a URL or download it first and then read it locally.The current behaviour for writing a remotely read package is to not copy the files to disk, since they are already available online. However, that makes it more difficult to 1) download a whole Data Package using R and 2) update a Data Package (e.g. adding a resource), because the originally local paths are now URLs pointing to an online CSV, and that might not be the version you want to point to.
Created on 2022-01-11 by the reprex package (v2.0.1)
The text was updated successfully, but these errors were encountered: