Learn R Programming

FREddyPro (version 1.0)

percentQC: Percent of each QC

Description

Gives the percentage of a each QC flag for a variable and writes the result either on the standard output or a text file.

Usage

percentQC(data, var = "co2_flux", qc_var = "qc_co2_flux", write = FALSE, dir = "./")

Arguments

data
A data frame
var
A string giving the name of the variable.
qc_var
A string giving the name of the QC variable
write
Logical. If true the output is written on a text file rather the standard output. The name of the output file is standard and is percent_qc_flags.txt.
dir
The directory to write the output file. If none given then the working directory will be used.

Value

Text with output percentages

Details

By default the function will give the percentage of each QC flag for CO2 flux. Other variables which have QC can be defined using the var option e.g., sensible heat, latent heat and momentum flux. The variable should have a QC flag for the function to work. If there is no QC flag associated with the variable, the result will be zero.

Examples

Run this code
##Load the data
data(fluxes)

## Find the percent of each QC flag for CO2 before cleaning
percentQC(fluxes)

## Do the same for sensible heat
percentQC(fluxes,var="H")

## Clean data
fluxes=cleanFluxes(fluxes,sdCor=TRUE,sdTimes=3,timesList=3,distCor=TRUE,
                   thresholdList=list(H=c(-100,1000),LE=c(-100,1000)))	

## Find the percent of each QC flag for CO2 after cleaning
percentQC(fluxes)

## Do the same for latent heat
percentQC(fluxes,var="H")

Run the code above in your browser using DataLab