MyNixOS website logo
Description

Access Files from 'Zenodo' Deposits.

Access, download and locally cache files deposited on 'Zenodo' <https://zenodo.org>.

zendown

R-CMD-check CRANstatus

Access, download and locally cache files deposited on Zenodo easily.

Installation

You can install the development version of zendown from GitHub with:

# install.packages("remotes")
remotes::install_github("rfsaldanha/zendown")

Example

library(zendown)

This Zenodo deposit contains RDS files from examples datasets.

First, you need to find the Zenodo deposit code. It is the number that appears on the end of a Zenodo deposit link. The code number also appears on the Zenodo DOI.

https://zenodo.org/records/10959197

Deposition code: 10959197

With the deposit code and the desired file name, you can just access the file with the zen_file function.

my_iris <- zen_file(deposit_id = 10959197, file_name = "iris.rds") |>
  readRDS()

head(my_iris)
#>   Sepal.Length Sepal.Width Petal.Length Petal.Width Species
#> 1          5.1         3.5          1.4         0.2  setosa
#> 2          4.9         3.0          1.4         0.2  setosa
#> 3          4.7         3.2          1.3         0.2  setosa
#> 4          4.6         3.1          1.5         0.2  setosa
#> 5          5.0         3.6          1.4         0.2  setosa
#> 6          5.4         3.9          1.7         0.4  setosa

The function will create a cache on your machine with all accessed files, avoiding re-downloading them when you access some file again.

Cache

By default, the cache is stored on a temporary folder that is cleaned when the R session is ended.

To use a persistent cache and other options, check this article.

More examples

# https://zenodo.org/records/10848
zen_file(10848, "DOAJ_Soc_Licenses_Correct.csv") |>
  read.csv2() |>
  tibble::tibble() |>
  head()
#> # A tibble: 6 × 12
#>       X DOAJNR Title Title.Alternative Identifier Publisher Language ISSN  EISSN
#>   <int>  <int> <chr> <chr>             <chr>      <chr>     <chr>    <chr> <chr>
#> 1     1     37 "Est…  <NA>             http://ww… "Univers… Spanish… 1405… <NA> 
#> 2     2     65 "Rev… "Review of Resea… http://rc… "Expert … English… 1583… 1584…
#> 3     3     85 "Soc…  <NA>             http://ej… "Firenze… English… 2038… <NA> 
#> 4     4    106 "Jou…  <NA>             http://jf… "New Pra… English  1945… 1944…
#> 5     5    195 "Oñ…  <NA>             http://op… "Oñati … English… 2079… <NA> 
#> 6     6    198 "Soc…  <NA>             http://so… "Associa… French   1950… <NA> 
#> # ℹ 3 more variables: CC.License.Doaj <chr>, CC.License.Checked <chr>,
#> #   Wrong.Cat.Doaj <chr>
# https://zenodo.org/records/10947952
zen_file(10947952, "2m_temperature_max.parquet") |>
  arrow::read_parquet() |>
  tibble::tibble() |>
  head()
#> # A tibble: 6 × 4
#>   code_muni date       name                    value
#>       <int> <date>     <chr>                   <dbl>
#> 1   1100015 2023-01-01 2m_temperature_max_mean  304.
#> 2   1100015 2023-01-02 2m_temperature_max_mean  302.
#> 3   1100015 2023-01-03 2m_temperature_max_mean  302.
#> 4   1100015 2023-01-04 2m_temperature_max_mean  302.
#> 5   1100015 2023-01-05 2m_temperature_max_mean  297.
#> 6   1100015 2023-01-06 2m_temperature_max_mean  302.
# https://zenodo.org/records/10889682
zen_file(10889682, "total_precipitation_2023-09-01_2023-09-30_day_sum.nc") |>
  terra::rast() |>
  terra::plot(1)

zen4R

To explore the Zenodo API possibilities to problematically store files and other procedures, check the zen4R package.

Metadata

Version

0.1.0

License

Unknown

Platforms (77)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-windows
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows