Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP fix bug in jasp-stats/jasp-test-release#2497 #34

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all 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
12 changes: 6 additions & 6 deletions R/commonPower.R
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@
if (sum(sapply(list(p, n, power, sig.level), is.null)) != 1) {
stop("exactly one of p, n, power, and sig.level must be NULL")
}
if (!is.null(n) && n < 2) {
if (!is.null(n) && any(n < 2)) {
stop("number of observations in the first group must be at least 2")
}
if (!is.null(sig.level) && (!is.numeric(sig.level) || any(0 > sig.level | sig.level > 1))) {
Expand Down Expand Up @@ -292,7 +292,7 @@
stop("exactly one of p1, n, n.ratio, power, and sig.level must be NULL")
}

if (!is.null(n) && n < 2) {
if (!is.null(n) && any(n < 2)) {
stop("number of observations in the first group must be at least 2")
}
if (!is.null(n.ratio) && n.ratio <= 0) {
Expand Down Expand Up @@ -383,7 +383,7 @@
stop("exactly one of rho, n, power, and sig.level must be NULL")
}

if (!is.null(n) && n < 2) {
if (!is.null(n) && any(n < 2)) {
stop("number of observations in the first group must be at least 2")
}
if (!is.null(sig.level) && (!is.numeric(sig.level) || any(0 > sig.level | sig.level > 1))) {
Expand All @@ -392,7 +392,7 @@
if (!is.null(power) && (!is.numeric(power) || any(0 > power | power > 1))) {
stop("power must be between 0 and 1")
}
if (!is.null(rho) && 0 > rho) {
if (!is.null(rho) && any(0 > rho)) {
stop("rho must be positive")
}
alternative <- match.arg(alternative)
Expand Down Expand Up @@ -470,7 +470,7 @@
stop("exactly one of rho, n, n.ratio, power, and sig.level must be NULL")
}

if (!is.null(n) && n < 2) {
if (!is.null(n) && any(n < 2)) {
stop("number of observations in the first group must be at least 2")
}
if (!is.null(n.ratio) && n.ratio <= 0) {
Expand All @@ -482,7 +482,7 @@
if (!is.null(power) && (!is.numeric(power) || any(0 > power | power > 1))) {
stop("power must be between 0 and 1")
}
if (!is.null(rho) && 0 > rho) {
if (!is.null(rho) && any(0 > rho)) {
stop("rho must be positive")
}
alternative <- match.arg(alternative)
Expand Down
Loading