mirror of
https://github.com/agdamsbo/stRoke.git
synced 2024-11-23 21:40:22 +01:00
Compare commits
No commits in common. "b955a96b617a399e0b4fe74c276ad0828b1b6510" and "559f9dee4e601e44df35f79f95006ec8c7736af6" have entirely different histories.
b955a96b61
...
559f9dee4e
10
.Rprofile
Normal file
10
.Rprofile
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
options(
|
||||||
|
renv.settings.snapshot.type = "explicit",
|
||||||
|
renv.config.auto.snapshot = TRUE,
|
||||||
|
renv.config.pak.enabled = TRUE
|
||||||
|
)
|
||||||
|
source("renv/activate.R")
|
||||||
|
|
||||||
|
if (interactive()) {
|
||||||
|
suppressMessages(require(usethis))
|
||||||
|
}
|
10
DESCRIPTION
10
DESCRIPTION
@ -1,6 +1,6 @@
|
|||||||
Package: stRoke
|
Package: stRoke
|
||||||
Title: Clinical Stroke Research
|
Title: Clinical Stroke Research
|
||||||
Version: 24.10.1
|
Version: 24.2.1
|
||||||
Authors@R:
|
Authors@R:
|
||||||
person("Andreas Gammelgaard", "Damsbo", , "agdamsbo@clin.au.dk", role = c("aut", "cre"),
|
person("Andreas Gammelgaard", "Damsbo", , "agdamsbo@clin.au.dk", role = c("aut", "cre"),
|
||||||
comment = c(ORCID = "0000-0002-7559-1154"))
|
comment = c(ORCID = "0000-0002-7559-1154"))
|
||||||
@ -17,7 +17,7 @@ BugReports: https://github.com/agdamsbo/stRoke/issues
|
|||||||
License: GPL-3
|
License: GPL-3
|
||||||
Encoding: UTF-8
|
Encoding: UTF-8
|
||||||
Roxygen: list(markdown = TRUE)
|
Roxygen: list(markdown = TRUE)
|
||||||
RoxygenNote: 7.3.2
|
RoxygenNote: 7.3.1
|
||||||
LazyData: true
|
LazyData: true
|
||||||
Suggests:
|
Suggests:
|
||||||
knitr,
|
knitr,
|
||||||
@ -25,11 +25,7 @@ Suggests:
|
|||||||
testthat,
|
testthat,
|
||||||
git2r,
|
git2r,
|
||||||
here,
|
here,
|
||||||
spelling,
|
spelling
|
||||||
usethis,
|
|
||||||
pak,
|
|
||||||
roxygen2,
|
|
||||||
devtools
|
|
||||||
Config/testthat/edition: 3
|
Config/testthat/edition: 3
|
||||||
Imports:
|
Imports:
|
||||||
calendar,
|
calendar,
|
||||||
|
6
NEWS.md
6
NEWS.md
@ -1,4 +1,4 @@
|
|||||||
# stRoke 24.10.1
|
# stRoke 24.2.1
|
||||||
|
|
||||||
### Functions:
|
### Functions:
|
||||||
|
|
||||||
@ -8,12 +8,8 @@
|
|||||||
|
|
||||||
* UPDATE: `add_padding()` updated to include option to add leading and/or tailing string with `lead` or `tail`.
|
* 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.
|
* 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
|
# stRoke 23.9.1
|
||||||
|
|
||||||
### Functions:
|
### Functions:
|
||||||
|
@ -42,8 +42,8 @@ ci_plot <-
|
|||||||
title = NULL,
|
title = NULL,
|
||||||
method = "auto") {
|
method = "auto") {
|
||||||
|
|
||||||
if (!method %in% c("auto", "model")){
|
if (!method %in% c("auto", "model"))
|
||||||
stop("Method has to either 'auto' or 'model'")}
|
stop("Method has to either 'auto' or 'model'")
|
||||||
|
|
||||||
if (method == "auto") {
|
if (method == "auto") {
|
||||||
if (!is.factor(ds[, y]))
|
if (!is.factor(ds[, y]))
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
utils::globalVariables(c("DTSTART"))
|
|
||||||
#' Convert data set to ical file
|
#' Convert data set to ical file
|
||||||
#'
|
#'
|
||||||
#' @param data data set
|
#' @param data data set
|
||||||
|
@ -36,13 +36,13 @@ generic_stroke <-
|
|||||||
gtsummary::add_overall()
|
gtsummary::add_overall()
|
||||||
|
|
||||||
x <- table(df[, c(group, score, strata)])
|
x <- table(df[, c(group, score, strata)])
|
||||||
f1 <- suppressWarnings(rankinPlot::grottaBar(
|
f1 <- rankinPlot::grottaBar(
|
||||||
x = x,
|
x = x,
|
||||||
groupName = group,
|
groupName = group,
|
||||||
scoreName = score,
|
scoreName = score,
|
||||||
strataName = strata,
|
strataName = strata,
|
||||||
colourScheme = "custom"
|
colourScheme = "custom"
|
||||||
))
|
)
|
||||||
|
|
||||||
df[, score] <- factor(df[, score], ordered = TRUE)
|
df[, score] <- factor(df[, score], ordered = TRUE)
|
||||||
|
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
utils::globalVariables(c("ndx"))
|
#' Title
|
||||||
#' Reverses relevant MFI subscores
|
|
||||||
#'
|
#'
|
||||||
#' @param d data frame or tibble
|
#' @param d data frame or tibble
|
||||||
#' @param var numeric vector of indices of columns to reverse
|
#' @param var numeric vector of indices of columns to reverse
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
#' Extract string based on regex pattern
|
#' Extract string based on regex pattern
|
||||||
#'
|
#'
|
||||||
#' DEPRECATION: moved to `agdamsbo/project.aid`
|
|
||||||
#'
|
|
||||||
#' Use base::strsplit to
|
#' Use base::strsplit to
|
||||||
#' @param d vector of character strings
|
#' @param d vector of character strings
|
||||||
#' @param pattern regex pattern to match
|
#' @param pattern regex pattern to match
|
||||||
|
@ -5,4 +5,4 @@ usethis::use_data(cprs, overwrite = TRUE)
|
|||||||
cprs <- data.frame(cpr=sample(c("2310450637", "010115-4000", "0101896000",
|
cprs <- data.frame(cpr=sample(c("2310450637", "010115-4000", "0101896000",
|
||||||
"010189-3000","300450-1030","010150-4021",
|
"010189-3000","300450-1030","010150-4021",
|
||||||
"011085-AKE3","0101EJ-ATW3"),200,TRUE))
|
"011085-AKE3","0101EJ-ATW3"),200,TRUE))
|
||||||
save(cprs,file="data/cprs.rda")
|
save(cprs,file="cprs.rda")
|
||||||
|
BIN
data/cprs.rda
BIN
data/cprs.rda
Binary file not shown.
@ -2,7 +2,7 @@
|
|||||||
% Please edit documentation in R/mfi_calc.R
|
% Please edit documentation in R/mfi_calc.R
|
||||||
\name{multi_rev}
|
\name{multi_rev}
|
||||||
\alias{multi_rev}
|
\alias{multi_rev}
|
||||||
\title{Reverses relevant MFI subscores}
|
\title{Title}
|
||||||
\usage{
|
\usage{
|
||||||
multi_rev(d, var)
|
multi_rev(d, var)
|
||||||
}
|
}
|
||||||
@ -15,7 +15,7 @@ multi_rev(d, var)
|
|||||||
data.frame or tibble depending on input
|
data.frame or tibble depending on input
|
||||||
}
|
}
|
||||||
\description{
|
\description{
|
||||||
Reverses relevant MFI subscores
|
Title
|
||||||
}
|
}
|
||||||
\examples{
|
\examples{
|
||||||
# rep_len(sample(1:5),length.out = 100) |> matrix(ncol=10) |> multi_rev(2:4)
|
# rep_len(sample(1:5),length.out = 100) |> matrix(ncol=10) |> multi_rev(2:4)
|
||||||
|
@ -15,9 +15,6 @@ str_extract(d, pattern)
|
|||||||
vector of character strings
|
vector of character strings
|
||||||
}
|
}
|
||||||
\description{
|
\description{
|
||||||
DEPRECATION: moved to \code{agdamsbo/project.aid}
|
|
||||||
}
|
|
||||||
\details{
|
|
||||||
Use base::strsplit to
|
Use base::strsplit to
|
||||||
}
|
}
|
||||||
\examples{
|
\examples{
|
||||||
|
7
renv/.gitignore
vendored
Normal file
7
renv/.gitignore
vendored
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
library/
|
||||||
|
local/
|
||||||
|
cellar/
|
||||||
|
lock/
|
||||||
|
python/
|
||||||
|
sandbox/
|
||||||
|
staging/
|
1180
renv/activate.R
Normal file
1180
renv/activate.R
Normal file
File diff suppressed because it is too large
Load Diff
19
renv/settings.json
Normal file
19
renv/settings.json
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
{
|
||||||
|
"bioconductor.version": null,
|
||||||
|
"external.libraries": [],
|
||||||
|
"ignored.packages": [],
|
||||||
|
"package.dependency.fields": [
|
||||||
|
"Imports",
|
||||||
|
"Depends",
|
||||||
|
"LinkingTo"
|
||||||
|
],
|
||||||
|
"ppm.enabled": null,
|
||||||
|
"ppm.ignored.urls": [],
|
||||||
|
"r.version": null,
|
||||||
|
"snapshot.type": "explicit",
|
||||||
|
"use.cache": true,
|
||||||
|
"vcs.ignore.cellar": true,
|
||||||
|
"vcs.ignore.library": true,
|
||||||
|
"vcs.ignore.local": true,
|
||||||
|
"vcs.manage.ignores": true
|
||||||
|
}
|
@ -15,4 +15,4 @@ LaTeX: pdfLaTeX
|
|||||||
BuildType: Package
|
BuildType: Package
|
||||||
PackageUseDevtools: Yes
|
PackageUseDevtools: Yes
|
||||||
PackageInstallArgs: --no-multiarch --with-keep.source
|
PackageInstallArgs: --no-multiarch --with-keep.source
|
||||||
PackageRoxygenize: rd,collate,namespace,vignette
|
PackageRoxygenize: rd,collate,namespace
|
||||||
|
3
tests/spelling.R
Normal file
3
tests/spelling.R
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
if(requireNamespace('spelling', quietly = TRUE))
|
||||||
|
spelling::spell_check_test(vignettes = TRUE, error = FALSE,
|
||||||
|
skip_on_cran = TRUE)
|
BIN
tests/testthat/Rplots.pdf
Normal file
BIN
tests/testthat/Rplots.pdf
Normal file
Binary file not shown.
@ -2,12 +2,12 @@ test_that("generic_stroke() runs!", {
|
|||||||
iris$ord <-
|
iris$ord <-
|
||||||
factor(sample(1:3, size = nrow(iris), replace = TRUE), ordered = TRUE)
|
factor(sample(1:3, size = nrow(iris), replace = TRUE), ordered = TRUE)
|
||||||
result <-
|
result <-
|
||||||
suppressMessages(generic_stroke(
|
generic_stroke(
|
||||||
df = iris,
|
df = iris,
|
||||||
group = "Species",
|
group = "Species",
|
||||||
score = "ord",
|
score = "ord",
|
||||||
variables = colnames(iris)[1:3]
|
variables = colnames(iris)[1:3]
|
||||||
))
|
)
|
||||||
expect_equal(length(result), 3)
|
expect_equal(length(result), 3)
|
||||||
expect_equal(class(result), "list")
|
expect_equal(class(result), "list")
|
||||||
expect_true("tbl_summary" %in% class(result[[1]]))
|
expect_true("tbl_summary" %in% class(result[[1]]))
|
||||||
|
Binary file not shown.
Loading…
Reference in New Issue
Block a user