Skip to content

Commit

Permalink
Clean lints in utils.R (#342)
Browse files Browse the repository at this point in the history
* Clean lints in utils.R

#334

* Apply automatic changes

* Update utils.R

* Revert "Update utils.R"

This reverts commit cb4c0ff.

* unlist Map output

Co-authored-by: IndrajeetPatil <IndrajeetPatil@users.noreply.github.com>
  • Loading branch information
IndrajeetPatil and IndrajeetPatil committed Jan 4, 2023
1 parent 286e3f2 commit 2433e96
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ VignetteBuilder:
knitr
Encoding: UTF-8
Language: en-US
RoxygenNote: 7.2.3
RoxygenNote: 7.2.3.9000
Roxygen: list(markdown = TRUE)
Config/testthat/edition: 3
Config/Needs/website:
Expand Down
21 changes: 11 additions & 10 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
cran_version <- lapply(pkgs[pkg_deps, "Version"], package_version)
local_version <- lapply(pkg_deps, utils::packageVersion)

behind <- mapply(">", cran_version, local_version)
behind <- unlist(Map(">", cran_version, local_version))

data.frame(
package = pkg_deps,
cran = sapply(cran_version, as.character),
local = sapply(local_version, as.character),
cran = vapply(cran_version, as.character, FUN.VALUE = character(1L)),
local = vapply(local_version, as.character, FUN.VALUE = character(1L)),
behind = behind,
stringsAsFactors = FALSE
)
Expand Down Expand Up @@ -49,12 +49,12 @@
cran_version <- lapply(pkgs[easystats_on_cran, "Version"], package_version)
local_version <- lapply(easystats_on_cran, utils::packageVersion)

behind <- mapply(">", cran_version, local_version)
behind <- unlist(Map(">", cran_version, local_version))

out <- data.frame(
package = easystats_on_cran,
cran = sapply(cran_version, as.character),
local = sapply(local_version, as.character),
cran = vapply(cran_version, as.character, FUN.VALUE = character(1L)),
local = vapply(local_version, as.character, FUN.VALUE = character(1L)),
behind = behind,
stringsAsFactors = FALSE,
row.names = NULL
Expand All @@ -71,7 +71,7 @@
out <- data.frame(
package = easystats_on_cran,
cran = NA,
local = sapply(local_version, as.character),
local = vapply(local_version, as.character, FUN.VALUE = character(1L)),
behind = FALSE,
stringsAsFactors = FALSE,
row.names = NULL
Expand All @@ -85,7 +85,7 @@
.add_easystats_dev_pkgs <- function(out, easystats_not_on_cran) {
if (length(easystats_not_on_cran) > 0L) {
# check if any dev-version is actually installed
easystats_not_on_cran <- sapply(
easystats_not_on_cran <- vapply(
easystats_not_on_cran,
function(i) {
p <- try(find.package(i, verbose = FALSE, quiet = TRUE))
Expand All @@ -94,7 +94,8 @@
} else {
""
}
}
},
FUN.VALUE = character(1L)
)

# remove empty
Expand All @@ -109,7 +110,7 @@
data.frame(
package = easystats_not_on_cran,
cran = NA,
local = sapply(local_version_dev, as.character),
local = vapply(local_version_dev, as.character, FUN.VALUE = character(1L)),
behind = FALSE,
stringsAsFactors = FALSE,
row.names = NULL
Expand Down

0 comments on commit 2433e96

Please sign in to comment.