Skip to content

Commit

Permalink
Enhance examples.
Browse files Browse the repository at this point in the history
  • Loading branch information
rfsaldanha committed Apr 12, 2024
1 parent fd8c6d1 commit a428285
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 6 deletions.
10 changes: 7 additions & 3 deletions R/delete_mirror.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@
#'
#' @examplesIf curl::has_internet() & RCurl::url.exists("https://zenodo.org/records/10959197", timeout.ms = 5000)
#' # https://zenodo.org/records/10959197
#' zen_file(10959197, "iris.rds")
#' file_path <- zen_file(10959197, "iris.rds")
#' print(file_path)
#' delete_mirror(10959197)
#' file.exists(file_path)
#'
#' @export
delete_mirror <- function(deposit_id){
Expand All @@ -30,8 +32,10 @@ delete_mirror <- function(deposit_id){
#'
#' @examplesIf curl::has_internet() & RCurl::url.exists("https://zenodo.org/records/10959197", timeout.ms = 5000)
#' # https://zenodo.org/records/10959197
#' zen_file(10959197, "iris.rds")
#' delete_all_mirrors()
#' file_path <- zen_file(10959197, "iris.rds")
#' print(file_path)
#' delete_all_mirrors(10959197)
#' file.exists(file_path)
#'
#' @export
delete_all_mirrors <- function(){
Expand Down
2 changes: 2 additions & 0 deletions R/download_deposit.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
#' res <- list_deposit(deposit_id = 10959197)
#' temp_dir <- tempdir()
#' download_deposit(list_deposit = res, dest = temp_dir, quiet = FALSE)
#' file.exists(file.path(temp_dir, "iris.rds"))
#' file.exists(file.path(temp_dir, "mtcars.rds"))
#'
#' @export
download_deposit <- function(list_deposit, file_name = NULL, dest, quiet = FALSE){
Expand Down
2 changes: 2 additions & 0 deletions R/mirror_deposit.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
#' @examplesIf curl::has_internet() & RCurl::url.exists("https://zenodo.org/records/10959197", timeout.ms = 5000)
#' # https://zenodo.org/records/10959197
#' mirror_deposit(deposit_id = 10959197)
#' file.exists(file.path(temp_dir, "iris.rds"))
#' file.exists(file.path(temp_dir, "mtcars.rds"))
#'
#' @export
#'
Expand Down
1 change: 1 addition & 0 deletions R/zen_file.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#' @examplesIf curl::has_internet() & RCurl::url.exists("https://zenodo.org/records/10959197", timeout.ms = 5000)
#' # https://zenodo.org/records/10959197
#' zen_file(10959197, "iris.rds")
#' file.exists(file.path(temp_dir, "iris.rds"))
#'
#' @export
zen_file <- function(deposit_id, file_name, clear_cache = FALSE, quiet = FALSE){
Expand Down
6 changes: 4 additions & 2 deletions man/delete_all_mirrors.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion man/delete_mirror.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions man/download_deposit.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit a428285

Please sign in to comment.