mirror of
https://github.com/agdamsbo/stRoke.git
synced 2024-11-23 05:20: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
|
||||
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,
|
||||
|
6
NEWS.md
6
NEWS.md
@ -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:
|
||||
|
@ -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]))
|
||||
|
@ -1,3 +1,4 @@
|
||||
utils::globalVariables(c("DTSTART"))
|
||||
#' Convert data set to ical file
|
||||
#'
|
||||
#' @param data data set
|
||||
|
@ -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)
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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")
|
||||
|
BIN
data/cprs.rda
BIN
data/cprs.rda
Binary file not shown.
@ -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)
|
||||
|
@ -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{
|
||||
|
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
|
||||
PackageUseDevtools: Yes
|
||||
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 <-
|
||||
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]]))
|
||||
|
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