Skip to content

Commit 8ec1c8d

Browse files
committed
update after long pause
1 parent e99ccf3 commit 8ec1c8d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+1109
-1869
lines changed

.DS_Store

6 KB
Binary file not shown.

.github/workflows/R-CMD-check.yaml

+24-13
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Workflow derived from https://github.com/r-lib/actions/tree/master/examples
1+
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
22
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
33
#
44
# NOTE: This workflow is overkill for most R packages and
@@ -12,6 +12,8 @@ on:
1212

1313
name: R-CMD-check
1414

15+
permissions: read-all
16+
1517
jobs:
1618
R-CMD-check:
1719
runs-on: ${{ matrix.config.os }}
@@ -22,31 +24,40 @@ jobs:
2224
fail-fast: false
2325
matrix:
2426
config:
25-
- {os: macOS-latest, r: 'release'}
27+
- {os: macos-latest, r: 'release'}
28+
2629
- {os: windows-latest, r: 'release'}
27-
# Use older ubuntu to maximise backward compatibility
28-
- {os: ubuntu-18.04, r: 'devel', http-user-agent: 'release'}
29-
- {os: ubuntu-18.04, r: 'release'}
30-
- {os: ubuntu-18.04, r: 'oldrel-1'}
31-
- {os: ubuntu-18.04, r: 'oldrel-2'}
30+
# use 4.1 to check with rtools40's older compiler
31+
- {os: windows-latest, r: '4.1'}
32+
33+
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
34+
- {os: ubuntu-latest, r: 'release'}
35+
- {os: ubuntu-latest, r: 'oldrel-1'}
36+
- {os: ubuntu-latest, r: 'oldrel-2'}
37+
- {os: ubuntu-latest, r: 'oldrel-3'}
38+
- {os: ubuntu-latest, r: 'oldrel-4'}
3239

3340
env:
3441
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
3542
R_KEEP_PKG_SOURCE: yes
3643

3744
steps:
38-
- uses: actions/checkout@v2
45+
- uses: actions/checkout@v4
3946

40-
- uses: r-lib/actions/setup-pandoc@v1
47+
- uses: r-lib/actions/setup-pandoc@v2
4148

42-
- uses: r-lib/actions/setup-r@v1
49+
- uses: r-lib/actions/setup-r@v2
4350
with:
4451
r-version: ${{ matrix.config.r }}
4552
http-user-agent: ${{ matrix.config.http-user-agent }}
4653
use-public-rspm: true
4754

48-
- uses: r-lib/actions/setup-r-dependencies@v1
55+
- uses: r-lib/actions/setup-r-dependencies@v2
4956
with:
50-
extra-packages: rcmdcheck
57+
extra-packages: any::rcmdcheck
58+
needs: check
5159

52-
- uses: r-lib/actions/check-r-package@v1
60+
- uses: r-lib/actions/check-r-package@v2
61+
with:
62+
upload-snapshots: true
63+
build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")'

.github/workflows/check-full.yaml

-58
This file was deleted.

DESCRIPTION

+4-2
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,17 @@ License: GPL (>= 3)
1616
Encoding: UTF-8
1717
ByteCompile: true
1818
Roxygen: list(markdown = TRUE)
19-
RoxygenNote: 7.1.2
19+
RoxygenNote: 7.3.1
2020
Depends:
2121
R (>= 3.5.0)
2222
Imports:
2323
data.table (>= 1.14.0),
2424
glue (>= 1.4.2),
25-
nortest (>= 1.0-4),
2625
effectsize (>= 0.4.5),
2726
afex (>= 0.28-1),
2827
PMCMRplus (>= 1.9.0),
2928
WRS2 (>= 1.1-1),
3029
lifecycle
30+
Suggests:
31+
testthat (>= 3.0.0)
32+
Config/testthat/edition: 3

NAMESPACE

+3-42
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
S3method(as.data.frame,writR)
44
S3method(print,writR)
55
export(aov_r)
6-
export(autest)
76
export(cent_disp)
87
export(clean_data)
98
export(contingency)
@@ -14,24 +13,18 @@ export(lablr)
1413
export(one_sample)
1514
export(pairs_two_sample)
1615
export(pairwise_test)
16+
export(rm_anova)
17+
export(sphericity)
1718
export(sphericity_check)
1819
export(style.p)
1920
export(two_sample)
2021
importFrom(PMCMRplus,durbinAllPairsTest)
2122
importFrom(PMCMRplus,gamesHowellTest)
2223
importFrom(PMCMRplus,kwAllPairsDunnTest)
23-
importFrom(WRS2,dep.effect)
2424
importFrom(WRS2,lincon)
25-
importFrom(WRS2,rmanova)
2625
importFrom(WRS2,rmmcp)
27-
importFrom(WRS2,t1way)
28-
importFrom(WRS2,trimse)
29-
importFrom(WRS2,wmcpAKP)
30-
importFrom(WRS2,yuen)
31-
importFrom(WRS2,yuen.effect.ci)
32-
importFrom(WRS2,yuend)
33-
importFrom(afex,aov_ez)
3426
importFrom(data.table,"%chin%")
27+
importFrom(data.table,"%like%")
3528
importFrom(data.table,":=")
3629
importFrom(data.table,.N)
3730
importFrom(data.table,.SD)
@@ -42,40 +35,8 @@ importFrom(data.table,fcase)
4235
importFrom(data.table,fifelse)
4336
importFrom(data.table,melt)
4437
importFrom(data.table,rbindlist)
45-
importFrom(data.table,rowidv)
46-
importFrom(data.table,setnames)
47-
importFrom(effectsize,cohens_d)
48-
importFrom(effectsize,cohens_g)
49-
importFrom(effectsize,cramers_v)
50-
importFrom(effectsize,eta_squared)
51-
importFrom(effectsize,hedges_g)
52-
importFrom(effectsize,kendalls_w)
53-
importFrom(effectsize,oddsratio)
54-
importFrom(effectsize,omega_squared)
55-
importFrom(effectsize,pearsons_c)
56-
importFrom(effectsize,rank_biserial)
57-
importFrom(effectsize,rank_epsilon_squared)
58-
importFrom(glue,glue)
5938
importFrom(lifecycle,deprecated)
60-
importFrom(nortest,lillie.test)
61-
importFrom(stats,IQR)
62-
importFrom(stats,anova)
63-
importFrom(stats,as.formula)
64-
importFrom(stats,chisq.test)
65-
importFrom(stats,complete.cases)
66-
importFrom(stats,fisher.test)
67-
importFrom(stats,friedman.test)
68-
importFrom(stats,kruskal.test)
69-
importFrom(stats,lm)
70-
importFrom(stats,mcnemar.test)
71-
importFrom(stats,median)
7239
importFrom(stats,na.omit)
73-
importFrom(stats,oneway.test)
7440
importFrom(stats,p.adjust)
7541
importFrom(stats,pairwise.t.test)
76-
importFrom(stats,pchisq)
77-
importFrom(stats,sd)
78-
importFrom(stats,shapiro.test)
79-
importFrom(stats,t.test)
80-
importFrom(stats,wilcox.test)
8142
importFrom(utils,combn)

R/aov_r.R

+29-30
Original file line numberDiff line numberDiff line change
@@ -11,48 +11,47 @@
1111
#' @param effsize.type The effect size used to estimate the effects of the factors on the response variable. Possible values are "eta" ("biased") or "omega" ("unbiased", the default).
1212
#' @param sphericity If "none", then sphericity assumption is assumed to be met for within-subject(s) factor(s). "GG": applies Greenhouse-Geisser correction. "HF": applies Hyunh-Feldt correction. 'auto' (Default) choose the appropiate correction based on Mauchly test of sphericity (p-value > 0.05)
1313
#' @param conf.level Confidence/Credible Interval (CI) level. Default to 0.95 (95%).
14-
#' @param lbl Logical (default FALSE) indicating if a report ready output is desired. This will change the output to a list with characters rather than numeric vectors.
1514
#' @param markdown Logical (default FALSE). If `lbl` is TRUE, then this argument specify if the report-ready labels should be formated for inline code for R markdown (using mathjax and markdown syntax), or if the output should be in plain text (the default).
16-
#' @importFrom data.table %chin% as.data.table .SD fcase .N
17-
#' @importFrom utils combn
18-
#' @importFrom stats anova
19-
#' @importFrom effectsize eta_squared omega_squared
15+
#' @param character.only Logical. checks whether to use the unevaluated expression or its
16+
#' content (when TRUE), asumming is a character vector. Defaults to `FALSE`.
2017
#' @return A list with statistical results.
18+
#'
2119
#' @export
2220

2321
aov_r <- function(data,
24-
response = NULL,
22+
response,
2523
between = NULL,
2624
within = NULL,
2725
rowid = NULL,
2826
ss_type = 3,
2927
effsize.type = "unbiased",
3028
sphericity = "auto",
3129
conf.level = 0.95,
32-
lbl = if (is.null(markdown)) FALSE else TRUE,
33-
markdown = NULL) {
30+
character.only = FALSE,
31+
markdown) {
3432

3533
`Pr(>F)` <- rn <- `num Df` <- `den Df` <- NULL
3634

37-
# Auxiliary functions
38-
is_empty <- function(i) length(i) == 0;
39-
is_not_empty <- function(i) length(i) > 0;
40-
is_not_null <- function(i) !is.null(i);
41-
42-
# Argument checking
43-
if (is.null(between) && is.null(within)) stop("between and within can't both be NULL", call. = FALSE)
44-
if (is.null(response)) stop("response can't be NULL", call. = FALSE)
45-
if (is_not_empty(within) && is.null(rowid)) stop("If within is provided, rowid can't be NULL", call. = FALSE)
35+
# Argument checking - Response
36+
if (missing(response)) stop("response can't be NULL", call. = FALSE)
4637

4738
# Transform data to data.table
48-
if (!"data.table" %chin% class(data)) {
49-
data <- data.table::as.data.table(data)
50-
}
39+
if (!"data.table" %chin% class(data)) data <- data.table::as.data.table(data)
40+
41+
# Transform arguments to character
42+
response <- deparser(response, character.only)
43+
between <- deparser(between, character.only)
44+
within <- deparser(within, character.only)
45+
rowid <- deparser(rowid, character.only)
46+
47+
# Argument checking - arguments
48+
if (is.null(between) && is.null(within)) stop("between and within can't both be NULL", call. = FALSE)
49+
if (!is.null(within) && is.null(rowid)) stop("if within is provided, rowid can't be NULL", call. = FALSE)
5150

5251
# Get only variables of interest
53-
data <- droplevels(data[j = .SD, .SDcols = c(rowid, response, between, within)])
52+
data <- droplevels(data[, .SD, .SDcols = c(rowid, response, between, within)])
5453

55-
if (is_empty(within) && is.null(rowid) && is_not_empty(between)) {
54+
if (length(within) == 0 && is.null(rowid) && length(between) > 0) {
5655
rowid <- "rowid"
5756
data[, rowid := seq_len(.N)]
5857
}
@@ -75,7 +74,7 @@ aov_r <- function(data,
7574
n_obs <- nrow(model$data$wide)
7675

7776
# Get sphericity correction
78-
if (is_empty(within)) {
77+
if (length(within) == 0) {
7978
sphericity <- NULL
8079
} else {
8180
sphericity <- sphericity_check(model)
@@ -100,11 +99,11 @@ aov_r <- function(data,
10099

101100
# Set sphericity correction (if available)
102101
within_method <- NA_character_
103-
if (is_not_null(within)) {
102+
if (!is.null(within)) {
104103
within_method <- data.table::fcase(
105-
sphericity == "none", "Fisher's repeated measures ANOVA",
106-
sphericity == "GG", "Repeated measures ANOVA with GG correction",
107-
sphericity == "HF", "Repeated measures ANOVA with HG correction"
104+
sphericity == "none", "Fisher's rmANOVA",
105+
sphericity == "GG", "Greenhouse-Geisser's rmANOVA",
106+
sphericity == "HF", "Huynh-Feldt's rmANOVA"
108107
)
109108
}
110109

@@ -116,8 +115,8 @@ aov_r <- function(data,
116115
df.error = `den Df`,
117116
p.value = `Pr(>F)`,
118117
method = data.table::fcase(rn %chin% between, "Fisher's ANOVA",
119-
rn %chin% within, within_method,
120-
utils::combn(within, 1, grepl, T, rn), within_method),
118+
rn %chin% within, within_method,
119+
utils::combn(within, 1, grepl, T, rn), within_method),
121120
estimate = efs[[2L]],
122121
conf.level = efs$CI,
123122
conf.low = efs$CI_low,
@@ -126,7 +125,7 @@ aov_r <- function(data,
126125
n_obs = n_obs
127126
)]
128127

129-
if (lbl) {
128+
if (!missing(markdown) && isTRUE(markdown)) {
130129
model <- model[j = lablr(.SD, markdown = markdown), by = "x"]
131130
}
132131

0 commit comments

Comments
 (0)