The hardware and bandwidth for this mirror is donated by dogado GmbH, the Webhosting and Full Service-Cloud Provider. Check out our Wordpress Tutorial.
If you wish to report a bug, or if you are interested in having us mirror your free-software or open-source project, please feel free to contact us at mirror[@]dogado.de.

Updating public repositories

Martin John Hadley, @martinjhnhadley

2022-05-09

The process for updating an existing public repository with new versions of existing files requires multiple steps:

  1. Delete existing copies of files
  2. Upload new copies of the files
  3. Make your changes public

Note that the example below is for a specific repository, as you are not the author of the article you will not be able to run the code without errors.

Delete existing copies of files

Obtain the article_id of the deposit, this is the numeric component of the DOI after figshare e.g. https://doi.org/10.6084/m9.figshare.3761562

library(rfigshare)
article_id <- 3761562
deposit_details <- fs_details(article_id)
deposit_details$title

Several files in this deposit are updated nightly, for instance:

"OLIdata_YYYY-MM-DD.txt"

To delete this file, the file_id must be found. It is simplest to convert the lists to a data_frame such that they may be operated on with dplyr.

library(dplyr)
deposit_files <- unlist(deposit_details$files)
deposit_files <- data.frame(split(deposit_files, names(deposit_files)),stringsAsFactors = F)
file_id <- deposit_files %>%
  filter(grepl("^OLIdata_", name)) %>%
  select(id) %>%
  .[[1]]

Prepare the article for the new version of the file, by deleting the existant version with fs_delete

fs_delete(article_id, file_id)

Upload new version of the file

The new file can be downloaded as follows:

# This file does not exist in these training materials.
fs_upload(article_id, paste0("OLIdata_", as.Date(Sys.time())))

Make changes public

The actions you have performed have been saved as draft changes, you must use fs_make_public to update the article and create a new version:

fs_make_public(article_id)

These binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.
Health stats visible at Monitor.