jranke / pfm

Compare 4bc95b3 ... +0 ... d81550d

No flags found

Use flags to group coverage reports by test type, project and/or folders.
Then setup custom commit statuses and notifications for each flag.

e.g., #unittest #integration

#production #enterprise

#frontend #backend

Learn more about Codecov Flags here.

Showing 1 of 51 files from the diff.
Other files ignored by Codecov
man/endpoint.Rd has changed.
docs/index.html has changed.
man/PEC_sw_sed.Rd has changed.
man/set_nd_nq.Rd has changed.
man/PEC_soil.Rd has changed.
man/TOXSWA_cwa.Rd has changed.
man/one_box.Rd has changed.
man/GUS.Rd has changed.
man/sawtooth.Rd has changed.
DESCRIPTION has changed.
ChangeLog has changed.
man/geomean.Rd has changed.

@@ -1,4 +1,4 @@
Loading
1 -
# Copyright (C) 2015  Johannes Ranke
1 +
# Copyright (C) 2015,2020  Johannes Ranke
2 2
# Contact: jranke@uni-bremen.de
3 3
# This file is part of the R package pfm
4 4
@@ -19,8 +19,9 @@
Loading
19 19
#'
20 20
#' Based on some posts in a thread on Stackoverflow
21 21
#' \url{http://stackoverflow.com/questions/2602583/geometric-mean-is-there-a-built-in}
22 -
#' This function checks for negative values, removes NA values per default and
23 -
#' returns 0 if at least one element of the vector is 0.
22 +
#' This function returns NA if NA values are present and na.rm = FALSE
23 +
#' (default). If negative values are present, it gives an error message.
24 +
#' If at least one element of the vector is 0, it returns 0.
24 25
#'
25 26
#' @param x Vector of numbers
26 27
#' @param na.rm Should NA values be omitted?
@@ -31,8 +32,8 @@
Loading
31 32
#' geomean(c(1, 3, 9))
32 33
#' geomean(c(1, 3, NA, 9))
33 34
#' \dontrun{geomean(c(1, -3, 9)) # returns an error}
34 -
geomean = function(x, na.rm = TRUE){
35 -
  if (any(is.na(x)) & na.rm == FALSE) stop("Removal of NA values was not requested")
35 +
geomean = function(x, na.rm = FALSE) {
36 +
  if (any(is.na(x)) & na.rm == FALSE) return(NA)
36 37
  if (any(x < 0, na.rm = na.rm)) stop("Only defined for positive numbers")
37 38
  exp(mean(log(x), na.rm = na.rm))
38 39
}

Everything is accounted for!

No changes detected that need to be reviewed.
What changes does Codecov check for?
Lines, not adjusted in diff, that have changed coverage data.
Files that introduced coverage data that had none before.
Files that have missing coverage data that once were tracked.
Files Coverage
R 69.12%
Project Totals (16 files) 69.12%
Loading