Skip to content

Commit

Permalink
continue updating documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
rfiorella committed Dec 23, 2024
1 parent 0811309 commit 6823dc3
Show file tree
Hide file tree
Showing 19 changed files with 60 additions and 40 deletions.
2 changes: 1 addition & 1 deletion R/calibrate_ambient_carbon_Bowling2003.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#' @param force_to_end In given month, calibrate ambient data later than last
#' calibration, using the last calibration? (default true)
#' @param force_to_beginning In given month, calibrate ambient data before than
#' first calibration, using the first calibration? (default true)
#' first calibration, using the firs t calibration? (default true)
#' @param r2_thres Minimum r2 value for calibration to be considered "good" and
#' applied to ambient data.
#' @param gap_fill_parameters Should function attempt to 'gap-fill' across a
Expand Down
5 changes: 4 additions & 1 deletion R/quality_control.R
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,10 @@ validate_output_file <- function(inname, outname, site, analyte) {
#--------------------------------------------------------------------
# Diagnostic plots:::

#' carbon_regression_plots
#' Make plots of carbon calibration data for debugging
#'
#' Makes plots of carbon calibration data regressions, primarily for
#' debugging and validation purposes.
#'
#' @author Rich Fiorella \email{rfiorella@@lanl.gov}
#'
Expand Down
12 changes: 10 additions & 2 deletions R/reference_data_extraction.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
#' extract_carbon_calibration_data.R
#' Extract only the data corresponding to validation/calibration time periods.
#'
#' Extracts data matching a value of "co2Low," "co2Med," or "co2High" which
#' correspond to the validation gases of known CO2, d13C that are fed to the
#' analyzer daily.
#'
#' @author Rich Fiorella \email{rfiorella@@lanl.gov}
#'
Expand Down Expand Up @@ -40,7 +44,11 @@ extract_carbon_cal_data <- function(data_list,
return(data)
}

#' extract_water_calibration_data
#' Extract only the data corresponding to validation/calibration time periods.
#'
#' Extracts data matching a value of "h2oLow," "h2oMed," or "h2oHigh" which
#' correspond to the validation gases of known d18O, d2H that are fed to the
#' analyzer daily.
#'
#' @author Rich Fiorella \email{rfiorella@@lanl.gov}
#'
Expand Down
8 changes: 4 additions & 4 deletions R/reference_data_regression.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#' loocv
#' Leave-one-out cross validation
#'
#' @author Rich Fiorella \email{rfiorella@@lanl.gov}
#'
Expand All @@ -12,7 +12,7 @@ loocv <- function(mod) {
return(base::mean((stats::residuals(mod) / (1 - h)) ^ 2))
}

#' estimate_calibration_error
#' Produce estimates of the calibration error.
#'
#' @author Rich Fiorella \email{rfiorella@@lanl.gov}
#'
Expand All @@ -38,7 +38,7 @@ estimate_calibration_error <- function(formula, data) {

}

#' fit_carbon_regression
#' Estimate slope/intercept of carbon isotope calibration regression
#'
#' @author Rich Fiorella \email{rfiorella@@lanl.gov}
#'
Expand Down Expand Up @@ -419,7 +419,7 @@ fit_carbon_regression <- function(ref_data, method, calibration_half_width,

}

#' fit_water_regression
#' Estimate slope/intercept of water isotope calibration regression
#'
#' @param ref_data Reference data.frame from which to estimate
#' calibration parameters.
Expand Down
2 changes: 1 addition & 1 deletion R/reference_data_selection.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# process_calibration_data
# functions to help select and filter validation data.

#' select_daily_reference_data
#' Select validation data corresponding to a particular day
#'
#' @param standard_df Input reference data.frame.
#' @param analyte Are we calibrating CO2 and H2O?
Expand Down
14 changes: 8 additions & 6 deletions R/restructure_data.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# restructure_data
#' ingest_data
# restructure_data script:
#==============================
#' Ingest and stack variables needed in calibration.
#'
#' @author Rich Fiorella \email{rfiorella@@lanl.gov}
#'
Expand Down Expand Up @@ -305,9 +306,10 @@ ingest_data <- function(inname,
}

#-----------------------------------------
# restructure_variables
# Restructure stacked data.frames to essential variables.
#'
#' Wrapper function around restructure_carbon_variables
#' Restructures data.frames imported by ingest_data to shorten variable names
#' and Wrapper function around restructure_carbon_variables
#' and restructure_water_variables.
#'
#' @author Rich Fiorella \email{rfiorella@@lanl.gov}
Expand Down Expand Up @@ -347,7 +349,7 @@ restructure_variables <- function(dataframe,
}

#-----------------------------------------
#' restructure_carbon_variables
#' Restructure ingested variables for the carbon isotope system.
#'
#' @param varname Which variable are we applying this function to? There's
#' a list of ~10 common ones to write to the hdf5 file.
Expand Down Expand Up @@ -455,7 +457,7 @@ restructure_carbon_variables <- function(dataframe,
}

#-----------------------------------------
#' restructure_water_variables
#' Restructure ingested variables for the water isotope system.
#'
#' @param varname Which variable are we applying this function to? There's
#' a list of ~10 common ones to write to the hdf5 file.
Expand Down
2 changes: 1 addition & 1 deletion man/calibrate_ambient_carbon_Bowling2003.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions man/carbon_regression_plots.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/estimate_calibration_error.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions man/extract_carbon_cal_data.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions man/extract_water_calibration_data.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/fit_carbon_regression.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/fit_water_regression.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/ingest_data.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/loocv.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/restructure_carbon_variables.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions man/restructure_variables.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/restructure_water_variables.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/select_daily_reference_data.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 6823dc3

Please sign in to comment.