Skip to content

Commit

Permalink
updates ahead of CRAN submission
Browse files Browse the repository at this point in the history
  • Loading branch information
ddsjoberg committed Jun 16, 2022
1 parent 75d4d31 commit f894869
Show file tree
Hide file tree
Showing 11 changed files with 32 additions and 28 deletions.
10 changes: 5 additions & 5 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -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", , "[email protected]", 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),
Expand All @@ -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
2 changes: 1 addition & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
@@ -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)
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions R/r_version.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ knitr::opts_chunk$set(
<!-- badges: start -->
[![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)
<!-- [![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)
<!-- badges: end -->

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.
Expand All @@ -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
Expand All @@ -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("<location(s) saved in Step 1>"))`.
*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()`.*

<img src = "https://github.com/ddsjoberg/updater/blob/main/man/figures/install_screenshot.png?raw=true">
13 changes: 6 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
<!-- [![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)
<!-- badges: end -->

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.

Expand All @@ -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

Expand All @@ -49,6 +48,6 @@ it’s important to re-install the packages and not copy them.
- Run
`updater::install_pkgs(lib.loc = c("<location(s) saved in Step 1>"))`.
*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()`.*

<img src = "https://github.com/ddsjoberg/updater/blob/main/man/figures/install_screenshot.png?raw=true">
7 changes: 5 additions & 2 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
## R CMD check results

0 errors | 0 warnings | 1 note
> checking CRAN incoming feasibility ... NOTE
Maintainer: 'Daniel D. Sjoberg <[email protected]>'
New submission

* This is a new release.
0 errors v | 0 warnings v | 1 note x

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

1 change: 1 addition & 0 deletions man/r_version.Rd

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

2 changes: 1 addition & 1 deletion man/updater-package.Rd

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

2 changes: 1 addition & 1 deletion tests/testthat/test-install_pkgs.R
Original file line number Diff line number Diff line change
@@ -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)
Expand Down

0 comments on commit f894869

Please sign in to comment.