Skip to content

Commit

Permalink
remove double cancellation
Browse files Browse the repository at this point in the history
  • Loading branch information
philchalmers committed Dec 17, 2024
1 parent 1d4ff01 commit bd4a1f6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions R/reverse.score.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
#'
#' @param data an object of class \code{data.frame}, \code{matrix}, or
#' \code{table} with the response patterns
#' @param which names of items in \code{data} that should be rescored. If missing
#' @param which names of items or column integer location
#' in \code{data} that should be rescored. If missing
#' the all columns in \code{data} will be reverse scored
#' @param range (optional) a named \code{list} to specify the low and high
#' score ranges. Specified names must match the names found in
Expand Down Expand Up @@ -94,7 +95,7 @@ reverse.score <- function(data, which, range = NULL, append = ".RS"){
max[pick] <- max(range[[i]])
}
}
subdat <- t((max - min) - t(subdat) + min)
subdat <- t(max - t(subdat) + min)
data[,which] <- subdat
nms <- colnames(data)
nms[nms %in% which] <- paste0(nms[nms %in% which], append)
Expand Down
3 changes: 2 additions & 1 deletion man/reverse.score.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit bd4a1f6

Please sign in to comment.