multiple updates and additions. see 'NEWS.md'

This commit is contained in:
Andreas Gammelgaard Damsbo 2024-10-10 14:13:16 +02:00
parent 559f9dee4e
commit 6434165e20
No known key found for this signature in database
18 changed files with 303 additions and 426 deletions

View File

@ -1,6 +1,6 @@
Package: stRoke
Title: Clinical Stroke Research
Version: 24.2.1
Version: 24.10.1
Authors@R:
person("Andreas Gammelgaard", "Damsbo", , "agdamsbo@clin.au.dk", role = c("aut", "cre"),
comment = c(ORCID = "0000-0002-7559-1154"))
@ -17,7 +17,7 @@ BugReports: https://github.com/agdamsbo/stRoke/issues
License: GPL-3
Encoding: UTF-8
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.3.1
RoxygenNote: 7.3.2
LazyData: true
Suggests:
knitr,
@ -25,7 +25,11 @@ Suggests:
testthat,
git2r,
here,
spelling
spelling,
usethis,
pak,
roxygen2,
devtools
Config/testthat/edition: 3
Imports:
calendar,

View File

@ -1,4 +1,4 @@
# stRoke 24.2.1
# stRoke 24.10.1
### Functions:
@ -8,8 +8,12 @@
* UPDATE: `add_padding()` updated to include option to add leading and/or tailing string with `lead` or `tail`.
* Moving: The following functions are moved to `agdamsbo/project.aid` to focus on (stroke) trial related functions: `str_extract()`.
* NEW: `mfi_calc()` calculates domain scores from the MFI questionnaire. Takes data frame of 20 ordered as the questionnaire. Default is to reverse questions with reverse scoring.
Checks set up with `rhub` v2
# stRoke 23.9.1
### Functions:

View File

@ -42,8 +42,8 @@ ci_plot <-
title = NULL,
method = "auto") {
if (!method %in% c("auto", "model"))
stop("Method has to either 'auto' or 'model'")
if (!method %in% c("auto", "model")){
stop("Method has to either 'auto' or 'model'")}
if (method == "auto") {
if (!is.factor(ds[, y]))

View File

@ -1,3 +1,4 @@
utils::globalVariables(c("DTSTART"))
#' Convert data set to ical file
#'
#' @param data data set

View File

@ -36,13 +36,13 @@ generic_stroke <-
gtsummary::add_overall()
x <- table(df[, c(group, score, strata)])
f1 <- rankinPlot::grottaBar(
f1 <- suppressWarnings(rankinPlot::grottaBar(
x = x,
groupName = group,
scoreName = score,
strataName = strata,
colourScheme = "custom"
)
))
df[, score] <- factor(df[, score], ordered = TRUE)

View File

@ -1,4 +1,5 @@
#' Title
utils::globalVariables(c("ndx"))
#' Reverses relevant MFI subscores
#'
#' @param d data frame or tibble
#' @param var numeric vector of indices of columns to reverse

View File

@ -1,5 +1,7 @@
#' Extract string based on regex pattern
#'
#' DEPRECATION: moved to `agdamsbo/project.aid`
#'
#' Use base::strsplit to
#' @param d vector of character strings
#' @param pattern regex pattern to match

View File

@ -5,4 +5,4 @@ usethis::use_data(cprs, overwrite = TRUE)
cprs <- data.frame(cpr=sample(c("2310450637", "010115-4000", "0101896000",
"010189-3000","300450-1030","010150-4021",
"011085-AKE3","0101EJ-ATW3"),200,TRUE))
save(cprs,file="cprs.rda")
save(cprs,file="data/cprs.rda")

Binary file not shown.

View File

@ -2,7 +2,7 @@
% Please edit documentation in R/mfi_calc.R
\name{multi_rev}
\alias{multi_rev}
\title{Title}
\title{Reverses relevant MFI subscores}
\usage{
multi_rev(d, var)
}
@ -15,7 +15,7 @@ multi_rev(d, var)
data.frame or tibble depending on input
}
\description{
Title
Reverses relevant MFI subscores
}
\examples{
# rep_len(sample(1:5),length.out = 100) |> matrix(ncol=10) |> multi_rev(2:4)

View File

@ -15,6 +15,9 @@ str_extract(d, pattern)
vector of character strings
}
\description{
DEPRECATION: moved to \code{agdamsbo/project.aid}
}
\details{
Use base::strsplit to
}
\examples{

498
renv.lock
View File

@ -1,6 +1,6 @@
{
"R": {
"Version": "4.3.1",
"Version": "4.4.1",
"Repositories": [
{
"Name": "CRAN",
@ -11,9 +11,9 @@
"Packages": {
"MASS": {
"Package": "MASS",
"Version": "7.3-60.0.1",
"Version": "7.3-61",
"Source": "Repository",
"Repository": "RSPM",
"Repository": "CRAN",
"Requirements": [
"R",
"grDevices",
@ -22,13 +22,13 @@
"stats",
"utils"
],
"Hash": "b765b28387acc8ec9e9c1530713cb19c"
"Hash": "0cafd6f0500e5deba33be22c46bf6055"
},
"Matrix": {
"Package": "Matrix",
"Version": "1.6-5",
"Version": "1.7-0",
"Source": "Repository",
"Repository": "RSPM",
"Repository": "CRAN",
"Requirements": [
"R",
"grDevices",
@ -39,7 +39,7 @@
"stats",
"utils"
],
"Hash": "8c7115cd3a0e048bda2a7cd110549f7a"
"Hash": "1920b2f11133b12350024297d8a4ff4a"
},
"R6": {
"Package": "R6",
@ -63,18 +63,18 @@
},
"Rcpp": {
"Package": "Rcpp",
"Version": "1.0.12",
"Version": "1.0.13",
"Source": "Repository",
"Repository": "RSPM",
"Repository": "CRAN",
"Requirements": [
"methods",
"utils"
],
"Hash": "5ea2700d21e038ace58269ecdbeb9ec0"
"Hash": "f27411eb6d9c3dada5edd444b8416675"
},
"V8": {
"Package": "V8",
"Version": "4.4.1",
"Version": "5.0.1",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
@ -83,17 +83,7 @@
"jsonlite",
"utils"
],
"Hash": "435359b59b8a9b8f9235135da471ea3c"
},
"backports": {
"Package": "backports",
"Version": "1.4.1",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
"R"
],
"Hash": "c39fbec8a30d23e721980b8afb31984c"
"Hash": "7f3867df00a91c63089beb85b9ef0208"
},
"base64enc": {
"Package": "base64enc",
@ -115,88 +105,23 @@
],
"Hash": "93637e906f3fe962413912c956eb44db"
},
"bit": {
"Package": "bit",
"Version": "4.0.5",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
"R"
],
"Hash": "d242abec29412ce988848d0294b208fd"
},
"bit64": {
"Package": "bit64",
"Version": "4.0.5",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
"R",
"bit",
"methods",
"stats",
"utils"
],
"Hash": "9fe98599ca456d6552421db0d6772d8f"
},
"bitops": {
"Package": "bitops",
"Version": "1.0-7",
"Version": "1.0-9",
"Source": "Repository",
"Repository": "CRAN",
"Hash": "b7d8d8ee39869c18d8846a184dd8a1af"
},
"broom": {
"Package": "broom",
"Version": "1.0.5",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
"R",
"backports",
"dplyr",
"ellipsis",
"generics",
"glue",
"lifecycle",
"purrr",
"rlang",
"stringr",
"tibble",
"tidyr"
],
"Hash": "fd25391c3c4f6ecf0fa95f1e6d15378c"
},
"broom.helpers": {
"Package": "broom.helpers",
"Version": "1.14.0",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
"R",
"broom",
"cli",
"dplyr",
"labelled",
"lifecycle",
"purrr",
"rlang",
"stats",
"stringr",
"tibble",
"tidyr"
],
"Hash": "ea30eb5d9412a4a5c2740685f680cd49"
"Hash": "d972ef991d58c19e6efa71b21f5e144b"
},
"bslib": {
"Package": "bslib",
"Version": "0.6.1",
"Version": "0.8.0",
"Source": "Repository",
"Repository": "RSPM",
"Repository": "CRAN",
"Requirements": [
"R",
"base64enc",
"cachem",
"fastmap",
"grDevices",
"htmltools",
"jquerylib",
@ -207,56 +132,62 @@
"rlang",
"sass"
],
"Hash": "c0d8599494bc7fb408cd206bbdd9cab0"
"Hash": "b299c6741ca9746fb227debcb0f9fb6c"
},
"cachem": {
"Package": "cachem",
"Version": "1.0.8",
"Version": "1.1.0",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
"fastmap",
"rlang"
],
"Hash": "c35768291560ce302c0a6589f92e837d"
"Hash": "cd9a672193789068eb5a2aad65a0dedf"
},
"calendar": {
"Package": "calendar",
"Version": "0.0.1",
"Version": "0.2.0",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
"R",
"cli",
"lubridate",
"methods",
"tibble"
],
"Hash": "ab478f470a5203ff9990e42d916005b0"
"Hash": "8204ab7185576575d91df30ef48a39b3"
},
"cards": {
"Package": "cards",
"Version": "0.3.0",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
"R",
"cli",
"dplyr",
"glue",
"rlang",
"tidyr",
"tidyselect"
],
"Hash": "2147e8448f4eb87197520fc1710855c7"
},
"cli": {
"Package": "cli",
"Version": "3.6.2",
"Version": "3.6.3",
"Source": "Repository",
"Repository": "RSPM",
"Repository": "CRAN",
"Requirements": [
"R",
"utils"
],
"Hash": "1216ac65ac55ec0058a6f75d7ca0fd52"
},
"clipr": {
"Package": "clipr",
"Version": "0.8.0",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
"utils"
],
"Hash": "3f038e5ac7f41d4ac41ce658c85e3042"
"Hash": "b21916dd77a27642b447374a5d30ecf3"
},
"colorspace": {
"Package": "colorspace",
"Version": "2.1-0",
"Version": "2.1-1",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
@ -266,57 +197,35 @@
"methods",
"stats"
],
"Hash": "f20c47fd52fae58b4e377c37bb8c335b"
"Hash": "d954cb1c57e8d8b756165d7ba18aa55a"
},
"commonmark": {
"Package": "commonmark",
"Version": "1.9.1",
"Version": "1.9.2",
"Source": "Repository",
"Repository": "CRAN",
"Hash": "5d8225445acb167abf7797de48b2ee3c"
},
"cpp11": {
"Package": "cpp11",
"Version": "0.4.7",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
"R"
],
"Hash": "5a295d7d963cc5035284dcdbaf334f4e"
},
"crayon": {
"Package": "crayon",
"Version": "1.5.2",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
"grDevices",
"methods",
"utils"
],
"Hash": "e8a1e41acf02548751f45c718d55aa6a"
"Hash": "14eb0596f987c71535d07c3aff814742"
},
"curl": {
"Package": "curl",
"Version": "5.2.0",
"Version": "5.2.3",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
"R"
],
"Hash": "ce88d13c0b10fe88a37d9c59dba2d7f9"
"Hash": "d91263322a58af798f6cf3b13fd56dde"
},
"digest": {
"Package": "digest",
"Version": "0.6.34",
"Version": "0.6.37",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
"R",
"utils"
],
"Hash": "7ede2ee9ea8d3edbf1ca84c1e333ad1a"
"Hash": "33698c4b3127fc9f506654607fb73676"
},
"dplyr": {
"Package": "dplyr",
@ -341,27 +250,15 @@
],
"Hash": "fedd9d00c2944ff00a0e2696ccf048ec"
},
"ellipsis": {
"Package": "ellipsis",
"Version": "0.3.2",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
"R",
"rlang"
],
"Hash": "bb0eec2fe32e88d9e2836c2f73ea2077"
},
"evaluate": {
"Package": "evaluate",
"Version": "0.23",
"Version": "1.0.0",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
"R",
"methods"
"R"
],
"Hash": "daf4a1246be12c1fa8c7705a0935c1a0"
"Hash": "6b567375113ceb7d9f800de4dd42218e"
},
"fansi": {
"Package": "fansi",
@ -377,17 +274,17 @@
},
"farver": {
"Package": "farver",
"Version": "2.1.1",
"Version": "2.1.2",
"Source": "Repository",
"Repository": "CRAN",
"Hash": "8106d78941f34855c440ddb946b8f7a5"
"Hash": "680887028577f3fa2a81e410ed0d6e42"
},
"fastmap": {
"Package": "fastmap",
"Version": "1.1.1",
"Version": "1.2.0",
"Source": "Repository",
"Repository": "CRAN",
"Hash": "f7736a18de97dea803bde0a2daaafb27"
"Hash": "aa5e1cd11c2d15497494c5292d7ffcc8"
},
"fontawesome": {
"Package": "fontawesome",
@ -401,32 +298,16 @@
],
"Hash": "c2efdd5f0bcd1ea861c2d4e2a883a67d"
},
"forcats": {
"Package": "forcats",
"Version": "1.0.0",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
"R",
"cli",
"glue",
"lifecycle",
"magrittr",
"rlang",
"tibble"
],
"Hash": "1a0a9a3d5083d0d573c4214576f1e690"
},
"fs": {
"Package": "fs",
"Version": "1.6.3",
"Version": "1.6.4",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
"R",
"methods"
],
"Hash": "47b5f30c720c23999b913a1a635cf0bb"
"Hash": "15aeb8c27f5ea5161f9f6a641fafd93a"
},
"generics": {
"Package": "generics",
@ -441,7 +322,7 @@
},
"ggplot2": {
"Package": "ggplot2",
"Version": "3.4.4",
"Version": "3.5.1",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
@ -462,22 +343,22 @@
"vctrs",
"withr"
],
"Hash": "313d31eff2274ecf4c1d3581db7241f9"
"Hash": "44c6a2f8202d5b7e878ea274b1092426"
},
"glue": {
"Package": "glue",
"Version": "1.7.0",
"Version": "1.8.0",
"Source": "Repository",
"Repository": "RSPM",
"Repository": "CRAN",
"Requirements": [
"R",
"methods"
],
"Hash": "e0b3a53876554bd45879e596cdb10a52"
"Hash": "5899f1eaa825580172bb56c08266f37c"
},
"gt": {
"Package": "gt",
"Version": "0.10.1",
"Version": "0.11.1",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
@ -503,13 +384,13 @@
"vctrs",
"xml2"
],
"Hash": "03009c105dfae79460b8eb9d8cf791e4"
"Hash": "3170d1f0f45e531c241179ab57cd30bd"
},
"gtable": {
"Package": "gtable",
"Version": "0.3.4",
"Version": "0.3.5",
"Source": "Repository",
"Repository": "RSPM",
"Repository": "CRAN",
"Requirements": [
"R",
"cli",
@ -518,95 +399,53 @@
"lifecycle",
"rlang"
],
"Hash": "b29cf3031f49b04ab9c852c912547eef"
"Hash": "e18861963cbc65a27736e02b3cd3c4a0"
},
"gtsummary": {
"Package": "gtsummary",
"Version": "1.7.2",
"Version": "2.0.3",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
"R",
"broom",
"broom.helpers",
"cards",
"cli",
"dplyr",
"forcats",
"glue",
"gt",
"knitr",
"lifecycle",
"purrr",
"rlang",
"stringr",
"tibble",
"tidyr",
"vctrs"
],
"Hash": "08df7405a102e3f0bdf7a13a29e8c6ab"
},
"haven": {
"Package": "haven",
"Version": "2.5.4",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
"R",
"cli",
"cpp11",
"forcats",
"hms",
"lifecycle",
"methods",
"readr",
"rlang",
"tibble",
"tidyselect",
"vctrs"
],
"Hash": "9171f898db9d9c4c1b2c745adc2c1ef1"
"Hash": "cd4d593e8ce0ad4e5c2c0acc50ce7330"
},
"highr": {
"Package": "highr",
"Version": "0.10",
"Version": "0.11",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
"R",
"xfun"
],
"Hash": "06230136b2d2b9ba5805e1963fa6e890"
},
"hms": {
"Package": "hms",
"Version": "1.1.3",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
"lifecycle",
"methods",
"pkgconfig",
"rlang",
"vctrs"
],
"Hash": "b59377caa7ed00fa41808342002138f9"
"Hash": "d65ba49117ca223614f71b60d85b8ab7"
},
"htmltools": {
"Package": "htmltools",
"Version": "0.5.7",
"Version": "0.5.8.1",
"Source": "Repository",
"Repository": "RSPM",
"Repository": "CRAN",
"Requirements": [
"R",
"base64enc",
"digest",
"ellipsis",
"fastmap",
"grDevices",
"rlang",
"utils"
],
"Hash": "2d7b3857980e0e0d0a1fd6f11928ab0f"
"Hash": "81d371a9cc60640e74e4ab6ac46dcedc"
},
"htmlwidgets": {
"Package": "htmlwidgets",
@ -627,7 +466,7 @@
"Package": "isoband",
"Version": "0.2.7",
"Source": "Repository",
"Repository": "RSPM",
"Repository": "CRAN",
"Requirements": [
"grid",
"utils"
@ -646,13 +485,13 @@
},
"jsonlite": {
"Package": "jsonlite",
"Version": "1.8.8",
"Version": "1.8.9",
"Source": "Repository",
"Repository": "RSPM",
"Repository": "CRAN",
"Requirements": [
"methods"
],
"Hash": "e1b9c55281c5adc4dd113652d9e26768"
"Hash": "4e993b65c2c3ffbffce7bb3e2c6f832b"
},
"juicyjuice": {
"Package": "juicyjuice",
@ -666,7 +505,7 @@
},
"knitr": {
"Package": "knitr",
"Version": "1.45",
"Version": "1.48",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
@ -678,7 +517,7 @@
"xfun",
"yaml"
],
"Hash": "1ec462871063897135c1bcbe0fc8f07d"
"Hash": "acf380f300c721da9fde7df115a5f86f"
},
"labeling": {
"Package": "labeling",
@ -691,26 +530,9 @@
],
"Hash": "b64ec208ac5bc1852b285f665d6368b3"
},
"labelled": {
"Package": "labelled",
"Version": "2.12.0",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
"R",
"dplyr",
"haven",
"lifecycle",
"rlang",
"stringr",
"tidyr",
"vctrs"
],
"Hash": "1ec27c624ece6c20431e9249bd232797"
},
"lattice": {
"Package": "lattice",
"Version": "0.22-5",
"Version": "0.22-6",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
@ -721,13 +543,13 @@
"stats",
"utils"
],
"Hash": "7c5e89f04e72d6611c77451f6331a091"
"Hash": "cc5ac1ba4c238c7ca9fa6a87ca11a7e2"
},
"lifecycle": {
"Package": "lifecycle",
"Version": "1.0.4",
"Source": "Repository",
"Repository": "RSPM",
"Repository": "CRAN",
"Requirements": [
"R",
"cli",
@ -761,7 +583,7 @@
},
"markdown": {
"Package": "markdown",
"Version": "1.12",
"Version": "1.13",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
@ -770,7 +592,7 @@
"utils",
"xfun"
],
"Hash": "765cf53992401b3b6c297b69e1edb8bd"
"Hash": "074efab766a9d6360865ad39512f2a7e"
},
"memoise": {
"Package": "memoise",
@ -812,18 +634,18 @@
},
"munsell": {
"Package": "munsell",
"Version": "0.5.0",
"Version": "0.5.1",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
"colorspace",
"methods"
],
"Hash": "6dfe8bf774944bd5595785e3229d8771"
"Hash": "4fd8900853b746af55b81fda99da7695"
},
"nlme": {
"Package": "nlme",
"Version": "3.1-164",
"Version": "3.1-166",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
@ -833,7 +655,7 @@
"stats",
"utils"
],
"Hash": "a623a2239e642806158bc4dc3f51565d"
"Hash": "ccbb8846be320b627e6aa2b4616a2ded"
},
"pillar": {
"Package": "pillar",
@ -862,30 +684,6 @@
],
"Hash": "01f28d4278f15c76cddbea05899c5d6f"
},
"prettyunits": {
"Package": "prettyunits",
"Version": "1.2.0",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
"R"
],
"Hash": "6b01fc98b1e86c4f705ce9dcfd2f57c7"
},
"progress": {
"Package": "progress",
"Version": "1.2.3",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
"R",
"R6",
"crayon",
"hms",
"prettyunits"
],
"Hash": "f4625e061cb2865f111b47ff163a5ca6"
},
"purrr": {
"Package": "purrr",
"Version": "1.0.2",
@ -925,13 +723,13 @@
},
"reactR": {
"Package": "reactR",
"Version": "0.5.0",
"Version": "0.6.1",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
"htmltools"
],
"Hash": "c9014fd1a435b2d790dd506589cb24e5"
"Hash": "b8e3d93f508045812f47136c7c44c251"
},
"reactable": {
"Package": "reactable",
@ -948,53 +746,30 @@
],
"Hash": "6069eb2a6597963eae0605c1875ff14c"
},
"readr": {
"Package": "readr",
"Version": "2.1.5",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
"R",
"R6",
"cli",
"clipr",
"cpp11",
"crayon",
"hms",
"lifecycle",
"methods",
"rlang",
"tibble",
"tzdb",
"utils",
"vroom"
],
"Hash": "9de96463d2117f6ac49980577939dfb3"
},
"renv": {
"Package": "renv",
"Version": "1.0.3",
"Version": "1.0.9",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
"utils"
],
"Hash": "41b847654f567341725473431dd0d5ab"
"Hash": "ef233f0e9064fc88c898b340c9add5c2"
},
"rlang": {
"Package": "rlang",
"Version": "1.1.3",
"Version": "1.1.4",
"Source": "Repository",
"Repository": "RSPM",
"Repository": "CRAN",
"Requirements": [
"R",
"utils"
],
"Hash": "42548638fae05fd9a9b5f3f437fbbbe2"
"Hash": "3eec01f8b1dee337674b2e34ab1f9bc1"
},
"rmarkdown": {
"Package": "rmarkdown",
"Version": "2.25",
"Version": "2.28",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
@ -1007,20 +782,19 @@
"jsonlite",
"knitr",
"methods",
"stringr",
"tinytex",
"tools",
"utils",
"xfun",
"yaml"
],
"Hash": "d65e35823c817f09f4de424fcdfa812a"
"Hash": "062470668513dcda416927085ee9bdc7"
},
"sass": {
"Package": "sass",
"Version": "0.4.8",
"Version": "0.4.9",
"Source": "Repository",
"Repository": "RSPM",
"Repository": "CRAN",
"Requirements": [
"R6",
"fs",
@ -1028,7 +802,7 @@
"rappdirs",
"rlang"
],
"Hash": "168f9353c76d4c4b0a0bbf72e2c2d035"
"Hash": "d53dbfddf695303ea4ad66f86e99b95d"
},
"scales": {
"Package": "scales",
@ -1052,7 +826,7 @@
},
"stringi": {
"Package": "stringi",
"Version": "1.8.3",
"Version": "1.8.4",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
@ -1061,7 +835,7 @@
"tools",
"utils"
],
"Hash": "058aebddea264f4c99401515182e656a"
"Hash": "39e1144fd75428983dc3f63aa53dfa91"
},
"stringr": {
"Package": "stringr",
@ -1124,7 +898,7 @@
},
"tidyselect": {
"Package": "tidyselect",
"Version": "1.2.0",
"Version": "1.2.1",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
@ -1136,7 +910,7 @@
"vctrs",
"withr"
],
"Hash": "79540e5fcd9e0435af547d885f184fd5"
"Hash": "829f27b9c4919c16b593794a6344d6c0"
},
"timechange": {
"Package": "timechange",
@ -1151,24 +925,13 @@
},
"tinytex": {
"Package": "tinytex",
"Version": "0.49",
"Version": "0.53",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
"xfun"
],
"Hash": "5ac22900ae0f386e54f1c307eca7d843"
},
"tzdb": {
"Package": "tzdb",
"Version": "0.4.0",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
"R",
"cpp11"
],
"Hash": "f561504ec2897f4d46f0c7657e488ae1"
"Hash": "9db859e8aabbb474293dde3097839420"
},
"utf8": {
"Package": "utf8",
@ -1204,55 +967,30 @@
],
"Hash": "c826c7c4241b6fc89ff55aaea3fa7491"
},
"vroom": {
"Package": "vroom",
"Version": "1.6.5",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
"R",
"bit64",
"cli",
"cpp11",
"crayon",
"glue",
"hms",
"lifecycle",
"methods",
"progress",
"rlang",
"stats",
"tibble",
"tidyselect",
"tzdb",
"vctrs",
"withr"
],
"Hash": "390f9315bc0025be03012054103d227c"
},
"withr": {
"Package": "withr",
"Version": "3.0.0",
"Version": "3.0.1",
"Source": "Repository",
"Repository": "RSPM",
"Repository": "CRAN",
"Requirements": [
"R",
"grDevices",
"graphics"
],
"Hash": "d31b6c62c10dcf11ec530ca6b0dd5d35"
"Hash": "07909200e8bbe90426fbfeb73e1e27aa"
},
"xfun": {
"Package": "xfun",
"Version": "0.42",
"Version": "0.48",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
"R",
"grDevices",
"stats",
"tools"
],
"Hash": "fd1349170df31f7a10bd98b0189e85af"
"Hash": "89e455b87c84e227eb7f60a1b4e5fe1f"
},
"xml2": {
"Package": "xml2",
@ -1269,10 +1007,10 @@
},
"yaml": {
"Package": "yaml",
"Version": "2.3.8",
"Version": "2.3.10",
"Source": "Repository",
"Repository": "CRAN",
"Hash": "29240487a071f535f5e5d5a323b7afbd"
"Hash": "51dab85c6c98e50a18d7551e9d49f76c"
}
}
}

View File

@ -2,11 +2,13 @@
local({
# the requested version of renv
version <- "1.0.3"
version <- "1.0.9"
attr(version, "sha") <- NULL
# the project directory
project <- getwd()
project <- Sys.getenv("RENV_PROJECT")
if (!nzchar(project))
project <- getwd()
# use start-up diagnostics if enabled
diagnostics <- Sys.getenv("RENV_STARTUP_DIAGNOSTICS", unset = "FALSE")
@ -31,6 +33,14 @@ local({
if (!is.null(override))
return(override)
# if we're being run in a context where R_LIBS is already set,
# don't load -- presumably we're being run as a sub-process and
# the parent process has already set up library paths for us
rcmd <- Sys.getenv("R_CMD", unset = NA)
rlibs <- Sys.getenv("R_LIBS", unset = NA)
if (!is.na(rlibs) && !is.na(rcmd))
return(FALSE)
# next, check environment variables
# TODO: prefer using the configuration one in the future
envvars <- c(
@ -50,9 +60,22 @@ local({
})
if (!enabled)
# bail if we're not enabled
if (!enabled) {
# if we're not enabled, we might still need to manually load
# the user profile here
profile <- Sys.getenv("R_PROFILE_USER", unset = "~/.Rprofile")
if (file.exists(profile)) {
cfg <- Sys.getenv("RENV_CONFIG_USER_PROFILE", unset = "TRUE")
if (tolower(cfg) %in% c("true", "t", "1"))
sys.source(profile, envir = globalenv())
}
return(FALSE)
}
# avoid recursion
if (identical(getOption("renv.autoloader.running"), TRUE)) {
warning("ignoring recursive attempt to run renv autoloader")
@ -75,6 +98,66 @@ local({
unloadNamespace("renv")
# load bootstrap tools
ansify <- function(text) {
if (renv_ansify_enabled())
renv_ansify_enhanced(text)
else
renv_ansify_default(text)
}
renv_ansify_enabled <- function() {
override <- Sys.getenv("RENV_ANSIFY_ENABLED", unset = NA)
if (!is.na(override))
return(as.logical(override))
pane <- Sys.getenv("RSTUDIO_CHILD_PROCESS_PANE", unset = NA)
if (identical(pane, "build"))
return(FALSE)
testthat <- Sys.getenv("TESTTHAT", unset = "false")
if (tolower(testthat) %in% "true")
return(FALSE)
iderun <- Sys.getenv("R_CLI_HAS_HYPERLINK_IDE_RUN", unset = "false")
if (tolower(iderun) %in% "false")
return(FALSE)
TRUE
}
renv_ansify_default <- function(text) {
text
}
renv_ansify_enhanced <- function(text) {
# R help links
pattern <- "`\\?(renv::(?:[^`])+)`"
replacement <- "`\033]8;;ide:help:\\1\a?\\1\033]8;;\a`"
text <- gsub(pattern, replacement, text, perl = TRUE)
# runnable code
pattern <- "`(renv::(?:[^`])+)`"
replacement <- "`\033]8;;ide:run:\\1\a\\1\033]8;;\a`"
text <- gsub(pattern, replacement, text, perl = TRUE)
# return ansified text
text
}
renv_ansify_init <- function() {
envir <- renv_envir_self()
if (renv_ansify_enabled())
assign("ansify", renv_ansify_enhanced, envir = envir)
else
assign("ansify", renv_ansify_default, envir = envir)
}
`%||%` <- function(x, y) {
if (is.null(x)) y else x
}
@ -108,6 +191,24 @@ local({
}
heredoc <- function(text, leave = 0) {
# remove leading, trailing whitespace
trimmed <- gsub("^\\s*\\n|\\n\\s*$", "", text)
# split into lines
lines <- strsplit(trimmed, "\n", fixed = TRUE)[[1L]]
# compute common indent
indent <- regexpr("[^[:space:]]", lines)
common <- min(setdiff(indent, -1L)) - leave
text <- paste(substring(lines, common), collapse = "\n")
# substitute in ANSI links for executable renv code
ansify(text)
}
startswith <- function(string, prefix) {
substring(string, 1, nchar(prefix)) == prefix
}
@ -268,7 +369,11 @@ local({
)
if ("headers" %in% names(formals(utils::download.file)))
args$headers <- renv_bootstrap_download_custom_headers(url)
{
headers <- renv_bootstrap_download_custom_headers(url)
if (length(headers) && is.character(headers))
args$headers <- headers
}
do.call(utils::download.file, args)
@ -347,10 +452,22 @@ local({
for (type in types) {
for (repos in renv_bootstrap_repos()) {
# build arguments for utils::available.packages() call
args <- list(type = type, repos = repos)
# add custom headers if available -- note that
# utils::available.packages() will pass this to download.file()
if ("headers" %in% names(formals(utils::download.file)))
{
headers <- renv_bootstrap_download_custom_headers(url)
if (length(headers) && is.character(headers))
args$headers <- headers
}
# retrieve package database
db <- tryCatch(
as.data.frame(
utils::available.packages(type = type, repos = repos),
do.call(utils::available.packages, args),
stringsAsFactors = FALSE
),
error = identity
@ -432,6 +549,14 @@ local({
}
renv_bootstrap_github_token <- function() {
for (envvar in c("GITHUB_TOKEN", "GITHUB_PAT", "GH_TOKEN")) {
envval <- Sys.getenv(envvar, unset = NA)
if (!is.na(envval))
return(envval)
}
}
renv_bootstrap_download_github <- function(version) {
enabled <- Sys.getenv("RENV_BOOTSTRAP_FROM_GITHUB", unset = "TRUE")
@ -439,16 +564,16 @@ local({
return(FALSE)
# prepare download options
pat <- Sys.getenv("GITHUB_PAT")
if (nzchar(Sys.which("curl")) && nzchar(pat)) {
token <- renv_bootstrap_github_token()
if (nzchar(Sys.which("curl")) && nzchar(token)) {
fmt <- "--location --fail --header \"Authorization: token %s\""
extra <- sprintf(fmt, pat)
extra <- sprintf(fmt, token)
saved <- options("download.file.method", "download.file.extra")
options(download.file.method = "curl", download.file.extra = extra)
on.exit(do.call(base::options, saved), add = TRUE)
} else if (nzchar(Sys.which("wget")) && nzchar(pat)) {
} else if (nzchar(Sys.which("wget")) && nzchar(token)) {
fmt <- "--header=\"Authorization: token %s\""
extra <- sprintf(fmt, pat)
extra <- sprintf(fmt, token)
saved <- options("download.file.method", "download.file.extra")
options(download.file.method = "wget", download.file.extra = extra)
on.exit(do.call(base::options, saved), add = TRUE)
@ -610,6 +735,9 @@ local({
# if the user has requested an automatic prefix, generate it
auto <- Sys.getenv("RENV_PATHS_PREFIX_AUTO", unset = NA)
if (is.na(auto) && getRversion() >= "4.4.0")
auto <- "TRUE"
if (auto %in% c("TRUE", "True", "true", "1"))
return(renv_bootstrap_platform_prefix_auto())
@ -801,24 +929,23 @@ local({
# the loaded version of renv doesn't match the requested version;
# give the user instructions on how to proceed
remote <- if (!is.null(description[["RemoteSha"]])) {
dev <- identical(description[["RemoteType"]], "github")
remote <- if (dev)
paste("rstudio/renv", description[["RemoteSha"]], sep = "@")
} else {
else
paste("renv", description[["Version"]], sep = "@")
}
# display both loaded version + sha if available
friendly <- renv_bootstrap_version_friendly(
version = description[["Version"]],
sha = description[["RemoteSha"]]
sha = if (dev) description[["RemoteSha"]]
)
fmt <- paste(
"renv %1$s was loaded from project library, but this project is configured to use renv %2$s.",
"- Use `renv::record(\"%3$s\")` to record renv %1$s in the lockfile.",
"- Use `renv::restore(packages = \"renv\")` to install renv %2$s into the project library.",
sep = "\n"
)
fmt <- heredoc("
renv %1$s was loaded from project library, but this project is configured to use renv %2$s.
- Use `renv::record(\"%3$s\")` to record renv %1$s in the lockfile.
- Use `renv::restore(packages = \"renv\")` to install renv %2$s into the project library.
")
catf(fmt, friendly, renv_bootstrap_version_friendly(version), remote)
FALSE
@ -1041,7 +1168,7 @@ local({
# if jsonlite is loaded, use that instead
if ("jsonlite" %in% loadedNamespaces()) {
json <- catch(renv_json_read_jsonlite(file, text))
json <- tryCatch(renv_json_read_jsonlite(file, text), error = identity)
if (!inherits(json, "error"))
return(json)
@ -1050,7 +1177,7 @@ local({
}
# otherwise, fall back to the default JSON reader
json <- catch(renv_json_read_default(file, text))
json <- tryCatch(renv_json_read_default(file, text), error = identity)
if (!inherits(json, "error"))
return(json)
@ -1063,14 +1190,14 @@ local({
}
renv_json_read_jsonlite <- function(file = NULL, text = NULL) {
text <- paste(text %||% read(file), collapse = "\n")
text <- paste(text %||% readLines(file, warn = FALSE), collapse = "\n")
jsonlite::fromJSON(txt = text, simplifyVector = FALSE)
}
renv_json_read_default <- function(file = NULL, text = NULL) {
# find strings in the JSON
text <- paste(text %||% read(file), collapse = "\n")
text <- paste(text %||% readLines(file, warn = FALSE), collapse = "\n")
pattern <- '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
locs <- gregexpr(pattern, text, perl = TRUE)[[1]]
@ -1118,14 +1245,14 @@ local({
map <- as.list(map)
# remap strings in object
remapped <- renv_json_remap(json, map)
remapped <- renv_json_read_remap(json, map)
# evaluate
eval(remapped, envir = baseenv())
}
renv_json_remap <- function(json, map) {
renv_json_read_remap <- function(json, map) {
# fix names
if (!is.null(names(json))) {
@ -1152,7 +1279,7 @@ local({
# recurse
if (is.recursive(json)) {
for (i in seq_along(json)) {
json[i] <- list(renv_json_remap(json[[i]], map))
json[i] <- list(renv_json_read_remap(json[[i]], map))
}
}

View File

@ -15,4 +15,4 @@ LaTeX: pdfLaTeX
BuildType: Package
PackageUseDevtools: Yes
PackageInstallArgs: --no-multiarch --with-keep.source
PackageRoxygenize: rd,collate,namespace
PackageRoxygenize: rd,collate,namespace,vignette

View File

@ -1,3 +0,0 @@
if(requireNamespace('spelling', quietly = TRUE))
spelling::spell_check_test(vignettes = TRUE, error = FALSE,
skip_on_cran = TRUE)

Binary file not shown.

View File

@ -2,12 +2,12 @@ test_that("generic_stroke() runs!", {
iris$ord <-
factor(sample(1:3, size = nrow(iris), replace = TRUE), ordered = TRUE)
result <-
generic_stroke(
suppressMessages(generic_stroke(
df = iris,
group = "Species",
score = "ord",
variables = colnames(iris)[1:3]
)
))
expect_equal(length(result), 3)
expect_equal(class(result), "list")
expect_true("tbl_summary" %in% class(result[[1]]))

Binary file not shown.