zenodoArchive
zenodoArchive
Object of R6Class for modelling an zenodoArchive for ASC cluster files
R6Class object.
doizenodoArchive doi, NULL is not supplied
all_versionszenodoArchive if to return all versions, true when not specified
sortzenodoArchive how to sort the records, mostrecent when not specified
pagezenodoArchive which page to pull in query, 1 when not specified
sizezenodoArchive how many records per page, 20 when not specified
zenodoVersionszenodoArchive doi available version, a storing variable.
zenodoQueryzenodoArchive doi version query, a storing variable.
download_filezenodoArchive doi downloads files, a storing variable.
download_urlzenodoArchive doi downloads urls, a storing variable.
new()initializes the zenodoArchive
zenodoArchive$new(
doi,
page = 1,
size = 20,
all_versions = "true",
sort = "mostrecent"
)doiA zenodo doi. To retrieve all records supply a concept doi (a generic doi common to all versions).
pageWhich page to query. Default is 1
sizeHow many records per page. Default is 20
all_versionsIf to return all concept doi versions. If true returns all, if false returns the latest. Default is ture
sortWhich sorting to apply on the records. Default is mostrecent. Possible sortings "bestmatch", "mostrecent", "-mostrecent" (ascending), "version", "-version" (ascending).
clean_doi()cleans the doi record for query
zenodoArchive$clean_doi(doi = self$doi)doiThe zenodo archive doi
the clean doi
zenodo_query()Query the zenodo archive according to the initial parameters.
zenodoArchive$zenodo_query(...)...Excepts the self created by initialize
a list with the query values.
get_versions()Extract all concept doi available versions.
zenodoArchive$get_versions(...)...Excepts the self created by initialize
a data.frame of the available versions.
get_version_files()get the chosen doi archive version available files
zenodoArchive$get_version_files(version = "latest")versionwhich archive version files to get. Default to latest. To see all available version use get_versions
a list of the available files in the archive version.
download_zenodo_files()get the chosen doi archive version available files
zenodoArchive$download_zenodo_files(
file = NULL,
path = tempdir(),
version = "latest",
all_files = F,
get_file_path = F,
quite = F
)fileIf supplied, downloads the specific file from the archive.
pathThe output folder for saving the archive files. Default is to a temporary directory.
versionwhich archive version files to get. Default to latest. To see all available version use get_versions
all_filesLogical (FALSE by default). Do you want to download all files in the archive.
get_file_pathLogical (FALSE by default). Do you want to return the path for the file downloaded.
quiteLogical (FALSE by default). Do you want to suppress informative messages
If get_file_path is TRUE, the function returns the path to the archive file
clone()The objects of this class are cloneable with this method.
zenodoArchive$clone(deep = FALSE)deepWhether to make a deep clone.
# \donttest{
zenodo_archive <- zenodoArchive$new(
doi = "10.5281/zenodo.7401189"
)
# view available version ins the archive
archive_versions <- zenodo_archive$get_versions()
# Getting the available files in the latest zenodo archive version
files <- zenodo_archive$get_version_files()
# downloading the first file from the latest archive version
zenodo_archive$download_zenodo_files()
# }
Run the code above in your browser using DataLab