The function fills in the existing column to hold outlier flags, and either overwrites the original file or outputs a data structure.

detect_outliers(
  data,
  iterations = 20,
  sigma = 2,
  grvi = FALSE,
  snowflag = FALSE,
  plot = FALSE,
  internal = TRUE,
  out_dir = tempdir()
)

Arguments

data

PhenoCam data structure or filename

iterations

number of itterations in order to detect outliers ()

sigma

number of deviations to exclude outliers at

grvi

reverse the direction of the screening intervals to accomodate for GRVI outliers

snowflag

use manual snow flag labels as outliers

plot

visualize the process, mostly for debugging (TRUE / FALSE = default)

internal

return a data structure if given a file on disk (TRUE / FALSE = default) to accomodate for GRVI outliers

out_dir

output directory where to store data

Examples


if (FALSE) {
# download demo data (do not detect outliers)
download_phenocam(site = "harvard$",
                  veg_type = "DB",
                  roi_id = "1000",
                  frequency = "3",
                  outlier_detection = FALSE)

# detect outliers in the downloaded file
detect_outliers(file.path(tempdir(),"harvard_DB_1000_3day.csv"))

}