Skip to content

Commit

Permalink
fixed typos in sctest_info
Browse files Browse the repository at this point in the history
  • Loading branch information
manuelarnold committed Sep 1, 2020
1 parent 1008d66 commit 99896d0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions R/sctest_info.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
sctest_info <- function(CSP, covariate, test, scaled_split, from, to) {
# Continuous covariate
if (test == "dm") {
CSP <- CSP[-1, drop = FALSE]
CSP <- CSP[-1, , drop = FALSE]
abs_CSP <- abs(x = CSP)
contrib <- apply(X = abs_CSP, MARGIN = 2, FUN = max)
if (scaled_split) {
Expand All @@ -16,7 +16,7 @@ sctest_info <- function(CSP, covariate, test, scaled_split, from, to) {
}

if (test == "cvm") {
CSP <- CSP[-1, drop = FALSE]
CSP <- CSP[-1, , drop = FALSE]
CSP2 <- CSP^2
contrib <- apply(X = CSP, MARGIN = 2, FUN = mean)
if (scaled_split) {
Expand Down Expand Up @@ -61,7 +61,7 @@ sctest_info <- function(CSP, covariate, test, scaled_split, from, to) {
# Ordinal covariate
if (test == "wdmo") {
covariate <- droplevels(covariate)
CSP <- CSP[-1, drop = FALSE]
CSP <- CSP[-1, , drop = FALSE]
freq <- prop.table(table(covariate))
freq <- freq / sum(freq)
ncat <- length(freq)
Expand All @@ -82,7 +82,7 @@ sctest_info <- function(CSP, covariate, test, scaled_split, from, to) {

if (test == "maxlmo") {
covariate <- droplevels(covariate)
CSP <- CSP[-1, drop = FALSE]
CSP <- CSP[-1, , drop = FALSE]
freq <- prop.table(table(covariate))
freq <- freq / sum(freq)
ncat <- length(freq)
Expand Down

0 comments on commit 99896d0

Please sign in to comment.