Skip to content

Commit

Permalink
adjustments to lintr and workflow adjustment
Browse files Browse the repository at this point in the history
  • Loading branch information
Xyarz committed Sep 5, 2023
1 parent b54481c commit c21ad45
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ jobs:
needs: lint

- name: Lint
run: tmp <- lintr::lint_package(); if (length(tmp) > 0) {print(tmp); stop("linter found problems")}
run: lintr::lint_package()
shell: Rscript {0}

6 changes: 3 additions & 3 deletions R/helper.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ BayesMCPMod <- function(
sign <- 0

for (j in 1:m) {
conttheta <- sapply(1:nrow(ancova[["est."]]), function(x) t(contMat[, j]) %*% ancova[["est."]][x, ])
contvar <- sapply(1:nrow(ancova[["est."]]), function(x) t(contMat[, j]^2) %*% ancova[["cov."]][x, ]^2)
p_ij <- sapply(1:nrow(ancova[["est."]]), function(x) stats::pnorm(conttheta[x] / sqrt(contvar[x])))
conttheta <- sapply(seq_len(nrow(ancova[["est."]])), function(x) t(contMat[, j]) %*% ancova[["est."]][x, ])

Check warning on line 22 in R/helper.R

View workflow job for this annotation

GitHub Actions / lint

file=R/helper.R,line=22,col=81,[line_length_linter] Lines should not be more than 80 characters.
contvar <- sapply(seq_len(nrow(ancova[["est."]])), function(x) t(contMat[, j]^2) %*% ancova[["cov."]][x, ]^2)
p_ij <- sapply(seq_len(nrow(ancova[["est."]])), function(x) stats::pnorm(conttheta[x] / sqrt(contvar[x])))


probs[j] <- sum(ancova[["obs."]] * p_ij)
Expand Down
2 changes: 1 addition & 1 deletion R/modelling.R
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ getGenAICs <- function(
exp_values <- exp(-0.5 * avgAIC_values)
denominator <- sum(exp_values)

for (i in 1:length(results)) {
for (i in seq_along(results)) {
results[[i]]$weightedAIC <- exp_values[i] / denominator
}

Expand Down

0 comments on commit c21ad45

Please sign in to comment.