Uploads the data and code compendium – data_and_code.zip, which
make_submission() and make_preprint() build – to a new Zenodo deposit,
fills in its description from the project, and reserves its DOI, so the
manuscript can cite the data before they are published. It never
publishes: the deposit stays a draft until you review it on Zenodo and
press Publish there, which cannot be undone. Nothing in the package needs
it; it runs only when you call it.
Arguments
- file
The compendium to upload.
NULL, the default, takes the newestdata_and_code.zipinsubmission/.- sandbox
TRUEdeposits on https://sandbox.zenodo.org, to try it.- token
The personal access token.
NULL, the default, readsZENODO_TOKEN, orZENODO_SANDBOX_TOKENwithsandbox = TRUE.- path
The project, or any folder inside it. Left out, the one
set_paper()named; with none named, this stops before writing: it writes into the project, and easypaper never takes the working directory for it.
Details
The description comes from the manuscript: the title (the short title,
short-title:, when there is one; the title otherwise), the authors with
their affiliations and ORCID (orcid: on an author), the keywords, and
the licence of the data, from the project's LICENSE.txt (CC BY 4.0 in a new
project). Zenodo refuses a whole deposit over one ORCID it cannot read, so
one that is not four groups of four digits – 0000-0000-0000-000X, the
last may be an X – is left out of it, with a warning naming the author:
add it on the draft, or correct it in manuscript.qmd and call again.
The deposit and its DOI are recorded
in the easypaper: block of _quarto.yml, so a second call – after the
data changed – replaces the file of the same draft instead of opening
another. A deposit already published is left alone: a new version of it
is made on Zenodo.
The DOI is written into the text wherever it says 10.5281/zenodo.XXXXXXX
– the placeholder of the data availability statement –, into the cover
letters of submission/ where they say [repository DOI], and into the
project's README.md, as a badge and in its citation; and it is printed,
to cite it wherever else it belongs. A cover letter written after
it carries the DOI from the start.
It needs a personal access token of Zenodo, with the scopes
deposit:write and deposit:actions: create one at
https://zenodo.org/account/settings/applications/tokens/new/ and put it in
your .Renviron as ZENODO_TOKEN=... (usethis::edit_r_environ() opens
it). To try it first, use Zenodo's sandbox, a copy of the site for tests:
a token from https://sandbox.zenodo.org as ZENODO_SANDBOX_TOKEN, and
sandbox = TRUE. A sandbox DOI does not resolve, so it is never written
into the text.
Examples
# It needs a Zenodo token (see Details), Quarto for the compendium, and a
# connection, so it does not run here.
if (FALSE) { # \dontrun{
make_submission(path = "my_paper")
deposit_zenodo(sandbox = TRUE, path = "my_paper")
deposit_zenodo(path = "my_paper")
} # }
