Skip to content

Commit

Permalink
Update R/processCapabilityStudies.R
Browse files Browse the repository at this point in the history
Co-authored-by: Don van den Bergh <[email protected]>
  • Loading branch information
JTPetter and vandenman authored Dec 7, 2024
1 parent 515543a commit 1bedb47
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions R/processCapabilityStudies.R
Original file line number Diff line number Diff line change
Expand Up @@ -2395,14 +2395,17 @@ processCapabilityStudies <- function(jaspResults, dataset, options) {
}

.pcTableFormatNumbers <- function(number) {
if (all(is.na(number)) || all(is.null(number))) {

if (is.null(number))
return(number)

if (all(is.na(number)))
return(rep(NA, length(number)))
}

output <- formatC(number, format = "f", digits = .numDecimals)
output <- sub("\\.?0+$", "", output)
if (any(is.na(number)) || any(is.null(number))) {
naNumbers <- which(is.na(number) | is.null(number))
output[naNumbers] <- NA
}
if (anyNA(number))
output[is.na(number)] <- NA

return(output)
}

0 comments on commit 1bedb47

Please sign in to comment.