Skip to contents

Returns a dataframe with energetic mean

Usage

avr.day.night(x, variable, period = "day", stat = "n_mean", ...)

Arguments

x

is a data frame

variable

is variable to apply function

period

is "day" or "night"

stat

is "n_mean" or "e_mean" like mean and energetic mean

...

another arguments

Value

dataframe of energetic mean values by night or daily period

Author

Pasquale Scordino p.scordino@arpa.piemonte.it

Simone Sperotto s.sperotto@arpa.piemonte.it

Examples

# Calculate energetic mean in nightly period (22-06)

#data(exampleHourlyData)

avr.day.night(exampleHourlyData, "leq", period = "night",
              stat = "e_mean")[1:5, ]
#>         DATA MEAN  MIN  MAX
#> 1 2020-12-11 56.1 46.9 60.3
#> 2 2020-12-12 54.9 46.5 60.0
#> 3 2020-12-13 56.5 46.3 61.5
#> 4 2020-12-14 56.5 48.4 61.3
#> 5 2020-12-15 56.9 48.6 62.4

# Calculate energetic mean in daily period (06-22)
avr.day.night(exampleHourlyData, "leq", period = "day",
              stat = "e_mean")[1:5, ]
#>         DATA MEAN  MIN  MAX
#> 1 2020-12-11 69.9   NA   NA
#> 2 2020-12-12 69.4 63.4 72.6
#> 3 2020-12-13 69.0 60.2 72.1
#> 4 2020-12-14 69.6 64.1 73.2
#> 5 2020-12-15 69.7 64.2 72.9

# Calculate mean in daily period (06-22)
avr.day.night(exampleHourlyData, "leq", period = "day",
              stat = "n_mean")[1:5, ]
#>         DATA  MEAN  MIN  MAX   SD
#> 1 2020-12-11 69.54   NA   NA   NA
#> 2 2020-12-12 68.79 63.4 72.6 2.49
#> 3 2020-12-13 68.17 60.2 72.1 3.13
#> 4 2020-12-14 69.06 64.1 73.2 2.38
#> 5 2020-12-15 69.14 64.2 72.9 2.43