mirror of
https://github.com/agdamsbo/stRoke.git
synced 2024-11-23 21:40:22 +01:00
Compare commits
2 Commits
559f9dee4e
...
b955a96b61
Author | SHA1 | Date | |
---|---|---|---|
b955a96b61 | |||
6434165e20 |
10
.Rprofile
10
.Rprofile
@ -1,10 +0,0 @@
|
|||||||
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.2.1
|
Version: 24.10.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.1
|
RoxygenNote: 7.3.2
|
||||||
LazyData: true
|
LazyData: true
|
||||||
Suggests:
|
Suggests:
|
||||||
knitr,
|
knitr,
|
||||||
@ -25,7 +25,11 @@ 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.2.1
|
# stRoke 24.10.1
|
||||||
|
|
||||||
### Functions:
|
### Functions:
|
||||||
|
|
||||||
@ -8,8 +8,12 @@
|
|||||||
|
|
||||||
* 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,3 +1,4 @@
|
|||||||
|
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 <- rankinPlot::grottaBar(
|
f1 <- suppressWarnings(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,4 +1,5 @@
|
|||||||
#' Title
|
utils::globalVariables(c("ndx"))
|
||||||
|
#' 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,5 +1,7 @@
|
|||||||
#' 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="cprs.rda")
|
save(cprs,file="data/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{Title}
|
\title{Reverses relevant MFI subscores}
|
||||||
\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{
|
||||||
Title
|
Reverses relevant MFI subscores
|
||||||
}
|
}
|
||||||
\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,6 +15,9 @@ 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
7
renv/.gitignore
vendored
@ -1,7 +0,0 @@
|
|||||||
library/
|
|
||||||
local/
|
|
||||||
cellar/
|
|
||||||
lock/
|
|
||||||
python/
|
|
||||||
sandbox/
|
|
||||||
staging/
|
|
1180
renv/activate.R
1180
renv/activate.R
File diff suppressed because it is too large
Load Diff
@ -1,19 +0,0 @@
|
|||||||
{
|
|
||||||
"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
|
PackageRoxygenize: rd,collate,namespace,vignette
|
||||||
|
@ -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.
@ -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 <-
|
||||||
generic_stroke(
|
suppressMessages(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]]))
|
||||||
|
BIN
tests/testthat/testthat-problems.rds
Normal file
BIN
tests/testthat/testthat-problems.rds
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user