Skip to contents

Summarise and annotate data

Usage

bru_summarise(
  data,
  probs = c(0.025, 0.5, 0.975),
  x = NULL,
  cbind.only = FALSE,
  max_moment = 2
)

Arguments

data

A list of samples, each either numeric or a data.frame

probs

A numeric vector of probabilities with values in [0, 1], passed to stats::quantile

x

A data.frame of data columns that should be added to the summary data frame

cbind.only

If TRUE, only cbind the samples and return a matrix where each column is a sample

max_moment

integer, at least 2. Determines the largest moment order information to include in the output. If max_moment > 2, includes "skew" (skewness, E[(x-m)^3/s^3]), and if max_moment > 3, includes "ekurtosis" (excess kurtosis, E[(x-m)^4/s^4] - 3). Default 2. Note that the Monte Carlo variability of the ekurtois estimate may be large.

Value

A data.frame or Spatial[Points/Pixels]DataFrame with summary statistics, "mean", "sd", paste0("q", probs), "mean.mc_std_err", "sd.mc_std_err"

Examples

bru_summarise(matrix(rexp(10000), 10, 1000), max_moment = 4, probs = NULL)
#>         mean        sd     skew ekurtosis sd.mc_std_err mean.mc_std_err
#> 1  1.0029219 1.0180685 2.168457  7.227269    0.04890246      0.03528701
#> 2  0.9503748 0.9268824 1.628765  2.808271    0.03214249      0.03134347
#> 3  0.9952103 0.9976464 2.027045  6.272503    0.04537511      0.03441812
#> 4  1.0110376 0.9633573 1.709907  3.634341    0.03616230      0.03275114
#> 5  0.9728174 0.9628626 1.674162  3.040448    0.03418654      0.03261053
#> 6  1.0152796 1.0680488 2.306443  7.677520    0.05253976      0.03709758
#> 7  0.9568688 0.9386959 2.008675  5.742233    0.04130325      0.03229642
#> 8  1.0640714 1.0513956 1.863190  4.760622    0.04323085      0.03598221
#> 9  1.0539425 1.1238265 2.332324  8.150454    0.05661804      0.03911935
#> 10 1.0280436 0.9886699 1.630193  2.839146    0.03439501      0.03343982