Skip to content
Merged
Show file tree
Hide file tree
Changes from 21 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 54 additions & 6 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
@@ -1,29 +1,77 @@
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
# .github/workflows/R-CMD-check.yaml
# Based on r-lib/actions examples; trimmed + one extra job to build the manual.

on:
push:
branches: [main, master]
branches: [master]
pull_request:
branches: [main, master]
branches: [master]

name: R-CMD-check

jobs:
R-CMD-check:
runs-on: ubuntu-latest
runs-on: ${{ matrix.config.os }}
name: ${{ matrix.config.os }} (${{ matrix.config.r }})
strategy:
fail-fast: false
matrix:
config:
- { os: macos-latest, r: "release" }
- { os: windows-latest, r: "release" }
- { os: ubuntu-latest, r: "devel", http-user-agent: "release" }
- { os: ubuntu-latest, r: "release" }
- { os: ubuntu-latest, r: "oldrel-1" }
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-pandoc@v2

- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
http-user-agent: ${{ matrix.config.http-user-agent }}
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
with:
needs: check
extra-packages: any::rcmdcheck

- uses: r-lib/actions/check-r-package@v2
with:
error-on: '"warning"'
upload-snapshots: true

# 2) Linux "full docs" check (build vignettes + PDF manual)
R-CMD-check-docs:
runs-on: ubuntu-latest
needs: R-CMD-check
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes
steps:
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-pandoc@v2
- uses: r-lib/actions/setup-r@v2
with:
r-version: "release"
use-public-rspm: true

- uses: r-lib/actions/setup-tinytex@v2

- uses: r-lib/actions/setup-r-dependencies@v2
with:
needs: check
extra-packages: any::rcmdcheck

- uses: r-lib/actions/check-r-package@v2
with:
args: 'c("--as-cran")'
build_args: 'c("--compact-vignettes=gs+qpdf")'
error-on: '"warning"'
upload-snapshots: true
10 changes: 6 additions & 4 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Package: corx
Type: Package
Title: Create and Format Correlation Matrices
Version: 1.0.7.2
Date: 2023-06-15
Version: 1.0.7.3
Date: 2025-11-03
Authors@R:
person(given = "James",
family = "Conigrave",
Expand All @@ -21,13 +21,15 @@ Imports:
glue,
clipr,
tidyselect,
rlang,
moments,
ggpubr,
ggplot2,
stats,
methods,
ppcor
RoxygenNote: 7.2.3
ppcor,
labelled
RoxygenNote: 7.3.3
Suggests:
covr,
papaja,
Expand Down
24 changes: 16 additions & 8 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
# corx 1.0.7.3

- Corx now can identify haven labelled variables as numeric

# corx 1.0.7.2

- Fixed issue with incorrect class declaration

# corx 1.0.7.1

* Fixed issue where misspelling columns did not result in error
* Removed leading zeros for p-values in to_table
* P-values are now rounded consistently to three decimal places
- Fixed issue where misspelling columns did not result in error
- Removed leading zeros for p-values in to_table
- P-values are now rounded consistently to three decimal places

# corx 1.0.7.0

* Removed magrittr pipe operator
* Added corx method for papaja::apa_table
* Now use cor.test for non-partial correlations
* Added ability to adjust p-values using stats::p.adjust
* Added new function "to_table" which provides additional options for corx tabulation (i.e., inclusion of p-values)
- Removed magrittr pipe operator
- Added corx method for papaja::apa_table
- Now use cor.test for non-partial correlations
- Added ability to adjust p-values using stats::p.adjust
- Added new function "to_table" which provides additional options for corx tabulation (i.e., inclusion of p-values)
30 changes: 19 additions & 11 deletions R/cormat_list.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,14 @@
#' @param method string, passed to cor.test
#' @param p_adjust string, passed to p.adjust

cormat_list <- function(data, x, y, z, method, p_adjust) {
cormat_list <- function(
data,
x,
y,
z,
method,
p_adjust
) {
cors <- list()

cormat <- matrix(nrow = length(x), ncol = length(y))
Expand All @@ -31,7 +38,6 @@ cormat_list <- function(data, x, y, z, method, p_adjust) {
cors$r[r, c] <- cor_ob$r
cors$n[r, c] <- cor_ob$n
cors$p[r, c] <- cor_ob$p

}
}

Expand All @@ -40,7 +46,6 @@ cormat_list <- function(data, x, y, z, method, p_adjust) {
}

cors

}

flex_cor <- function(x, y, z = NULL, method, data) {
Expand Down Expand Up @@ -70,13 +75,16 @@ flex_cor <- function(x, y, z = NULL, method, data) {
method = method
)

list(r = cor_ob.partial$estimate,
n = cor_ob.partial$n,
p = cor_ob.partial$p.value)
} else{
list(r = 1,
n = nrow(partial_data),
p = 1)
list(
r = cor_ob.partial$estimate,
n = cor_ob.partial$n,
p = cor_ob.partial$p.value
)
} else {
list(
r = 1,
n = nrow(partial_data),
p = 1
)
}

}
Loading