Skip to content

Commit 8c9580d

Browse files
committed
Add 90th Percentile to stats()
1 parent 9f70b9b commit 8c9580d

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

R/stats.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#' in the time series.
66
#'
77
#' @return Data frame with rows per site and columns for minimum, median,
8-
#' mean, standard diviation and maximum
8+
#' maximum, the 25th, 75th and 90th Percentile, mean and standard deviation
99
#'
1010
#' @importFrom stats quantile sd
1111
#' @export
@@ -16,10 +16,10 @@ stats <- function(
1616
d <- dataFrame[,-grep(pattern = "posixDateTime", x = colnames(dataFrame))]
1717
df_out <- t(sapply(d, function(x){
1818
v_out <- c(
19-
quantile(x = x),
19+
quantile(x = x, probs = c(0, 0.25, 0.5, 0.75, 0.9, 1)),
2020
mean(x),
2121
sd(x))
22-
names(v_out) <- c("min", "q25", "median", "q75", "max", "mean", "sd")
22+
names(v_out) <- c("min", "q25", "median", "q75", "q90", "max", "mean", "sd")
2323
v_out
2424
}))
2525
df_out <- qsimVis::add_site_info(

man/stats.Rd

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)