From f894869eb2da799fdf8caf36477fdc350c80c540 Mon Sep 17 00:00:00 2001 From: Daniel Sjoberg Date: Thu, 16 Jun 2022 18:36:31 -0400 Subject: [PATCH] updates ahead of CRAN submission --- DESCRIPTION | 10 +++++----- NAMESPACE | 2 +- ...brary_loc.R => find_previous_library_location.R} | 4 ++-- R/r_version.R | 1 + README.Rmd | 8 ++++---- README.md | 13 ++++++------- cran-comments.md | 7 +++++-- ...ary_loc.Rd => find_previous_library_location.Rd} | 10 +++++----- man/r_version.Rd | 1 + man/updater-package.Rd | 2 +- tests/testthat/test-install_pkgs.R | 2 +- 11 files changed, 32 insertions(+), 28 deletions(-) rename R/{find_previous_library_loc.R => find_previous_library_location.R} (95%) rename man/{find_previous_library_loc.Rd => find_previous_library_location.Rd} (68%) diff --git a/DESCRIPTION b/DESCRIPTION index ab106aa..1e3e7e5 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,14 +1,14 @@ Package: updater -Title: Utilities When Updating R -Version: 0.0.0.9000 +Title: Utilities for Updating R +Version: 0.1.0 Authors@R: person("Daniel D.", "Sjoberg", , "danield.sjoberg@gmail.com", role = c("aut", "cre", "cph"), comment = c(ORCID = "0000-0003-0862-2018")) Description: When updating major or minor R versions all packages should be re-installed. The utilities in this package assist in getting a user up-and-running again by installing all previously installed R - packages. The package uses 'renv' to install; immediately - replenishing your 'renv' package cache. + packages. The package uses 'renv' to install; immediately replenishing + your 'renv' package cache. License: MIT + file LICENSE Imports: cli (>= 3.3.0), @@ -19,6 +19,6 @@ Suggests: testthat (>= 3.0.0) Config/testthat/edition: 3 Encoding: UTF-8 +Language: en-US Roxygen: list(markdown = TRUE) RoxygenNote: 7.2.0 -Language: en-US diff --git a/NAMESPACE b/NAMESPACE index 8419058..1d51474 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -1,6 +1,6 @@ # Generated by roxygen2: do not edit by hand -export(find_previous_library_loc) +export(find_previous_library_location) export(install_pkgs) export(previous_r_version) export(r_version) diff --git a/R/find_previous_library_loc.R b/R/find_previous_library_location.R similarity index 95% rename from R/find_previous_library_loc.R rename to R/find_previous_library_location.R index e9a4a4d..0aa6321 100644 --- a/R/find_previous_library_loc.R +++ b/R/find_previous_library_location.R @@ -10,9 +10,9 @@ #' @export #' #' @examples -#' find_previous_library_loc() +#' find_previous_library_location() -find_previous_library_loc <- function() { +find_previous_library_location <- function() { # stop if can't find the previous R version ---------------------------------- if (is.null(previous_r_version())) { cli::cli_alert_danger(give_up_msg) diff --git a/R/r_version.R b/R/r_version.R index db2f0bc..78c87de 100644 --- a/R/r_version.R +++ b/R/r_version.R @@ -2,6 +2,7 @@ #' #' These functions return the current R version and the #' the previously installed R version. +#' The format of the returned version matches the default folder name where R is installed. #' #' @return string of R version #' @name r_version diff --git a/README.Rmd b/README.Rmd index 0904ed2..42628e8 100644 --- a/README.Rmd +++ b/README.Rmd @@ -18,12 +18,12 @@ knitr::opts_chunk$set( [![R-CMD-check](https://github.com/ddsjoberg/updater/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/ddsjoberg/updater/actions/workflows/R-CMD-check.yaml) [![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental) -[![CRAN status](https://www.r-pkg.org/badges/version/updater)](https://CRAN.R-project.org/package=updater) + [![Codecov test coverage](https://codecov.io/gh/ddsjoberg/updater/branch/main/graph/badge.svg)](https://app.codecov.io/gh/ddsjoberg/updater?branch=main) The goal of updater is to ease the R update process. -The package will re-install packages available on your previous version of R into the system library of your new installation. +The package will _re-install_ packages available on your previous version of R into the system library of your new installation. The package uses {renv} to install the packages, adding each installation into your {renv} cache. Importantly, the package _re-installs_ the packages and does _not_ copy them from the previous R installation library. @@ -35,7 +35,7 @@ R packages for minor R releases (e.g. R 4.1 to R 4.2) may _not_ be compatible, w - Open your current version of R (before you update), and type `.libPaths()` into the console. The current R system library locations will print to the console: save these file locations, e.g. copy and past the locations into Notepad or TextEdit. - - It may be possible to skip this step and find the library location by calling `find_previous_library_loc()` from your updated R, + - It may be possible to skip this step and find the library location by calling `find_previous_library_location()` from your updated R session, but it's recommended to use `.libPaths()` now to ensure accuracy. 2. Install R @@ -46,6 +46,6 @@ R packages for minor R releases (e.g. R 4.1 to R 4.2) may _not_ be compatible, w - Open your new version of R and install the {updater} package with `install.packages("updater")`. - Run `updater::install_pkgs(lib.loc = c(""))`. - *As mentioned above, if you didn't record the location, you may try to locate it with `find_previous_library_loc()`.* + *As mentioned above, if you didn't record the location, you may try to locate it with `find_previous_library_location()`.* diff --git a/README.md b/README.md index 148ddd2..6c95f7c 100644 --- a/README.md +++ b/README.md @@ -8,14 +8,13 @@ [![R-CMD-check](https://github.com/ddsjoberg/updater/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/ddsjoberg/updater/actions/workflows/R-CMD-check.yaml) [![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental) -[![CRAN -status](https://www.r-pkg.org/badges/version/updater)](https://CRAN.R-project.org/package=updater) + [![Codecov test coverage](https://codecov.io/gh/ddsjoberg/updater/branch/main/graph/badge.svg)](https://app.codecov.io/gh/ddsjoberg/updater?branch=main) The goal of updater is to ease the R update process. The package will -re-install packages available on your previous version of R into the +*re-install* packages available on your previous version of R into the system library of your new installation. The package uses {renv} to install the packages, adding each installation into your {renv} cache. @@ -33,9 +32,9 @@ it’s important to re-install the packages and not copy them. locations will print to the console: save these file locations, e.g. copy and past the locations into Notepad or TextEdit. - It may be possible to skip this step and find the library - location by calling `find_previous_library_loc()` from your - updated R, but it’s recommended to use `.libPaths()` now to - ensure accuracy. + location by calling `find_previous_library_location()` from your + updated R session, but it’s recommended to use `.libPaths()` now + to ensure accuracy. 2. Install R @@ -49,6 +48,6 @@ it’s important to re-install the packages and not copy them. - Run `updater::install_pkgs(lib.loc = c(""))`. *As mentioned above, if you didn’t record the location, you may - try to locate it with `find_previous_library_loc()`.* + try to locate it with `find_previous_library_location()`.* diff --git a/cran-comments.md b/cran-comments.md index 858617d..344201a 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -1,5 +1,8 @@ ## R CMD check results -0 errors | 0 warnings | 1 note +> checking CRAN incoming feasibility ... NOTE + Maintainer: 'Daniel D. Sjoberg ' + + New submission -* This is a new release. +0 errors v | 0 warnings v | 1 note x diff --git a/man/find_previous_library_loc.Rd b/man/find_previous_library_location.Rd similarity index 68% rename from man/find_previous_library_loc.Rd rename to man/find_previous_library_location.Rd index 63f922d..1d866c8 100644 --- a/man/find_previous_library_loc.Rd +++ b/man/find_previous_library_location.Rd @@ -1,10 +1,10 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/find_previous_library_loc.R -\name{find_previous_library_loc} -\alias{find_previous_library_loc} +% Please edit documentation in R/find_previous_library_location.R +\name{find_previous_library_location} +\alias{find_previous_library_location} \title{Find Package Library} \usage{ -find_previous_library_loc() +find_previous_library_location() } \value{ package library location @@ -17,5 +17,5 @@ Rather, we recommend that a user simply opens the previous version of R and runs \code{.libPaths()} to find the library location(s). } \examples{ -find_previous_library_loc() +find_previous_library_location() } diff --git a/man/r_version.Rd b/man/r_version.Rd index bc09e67..8beb8bb 100644 --- a/man/r_version.Rd +++ b/man/r_version.Rd @@ -15,6 +15,7 @@ string of R version \description{ These functions return the current R version and the the previously installed R version. +The format of the returned version matches the default folder name where R is installed. } \examples{ r_version() diff --git a/man/updater-package.Rd b/man/updater-package.Rd index 34c2caa..bb8164f 100644 --- a/man/updater-package.Rd +++ b/man/updater-package.Rd @@ -4,7 +4,7 @@ \name{updater-package} \alias{updater} \alias{updater-package} -\title{updater: Utilities When Updating R} +\title{updater: Utilities for Updating R} \description{ When updating major or minor R versions all packages should be re-installed. The utilities in this package assist in getting a user up-and-running again by installing all previously installed R packages. The package uses 'renv' to install; immediately replenishing your 'renv' package cache. } diff --git a/tests/testthat/test-install_pkgs.R b/tests/testthat/test-install_pkgs.R index f2bd709..c6fba85 100644 --- a/tests/testthat/test-install_pkgs.R +++ b/tests/testthat/test-install_pkgs.R @@ -1,7 +1,7 @@ test_that("install_pkgs() works", { expect_error(r_version(), NA) expect_error(previous_r_version(), NA) - expect_error(find_previous_library_loc(), NA) + expect_error(find_previous_library_location(), NA) expect_error(df_pkgs_to_install <- get_installed_pkgs(), NA) expect_error(walk(letters, print), NA) expect_error(print_repos_and_pkgs(df_pkgs_to_install), NA)