knitr::opts_chunk$set(warning = FALSE) knitr::opts_chunk$set(message = FALSE) rmarkdown.html_vignette.check_title = FALSE
Install aelab
package from Github. devtools
need to be install though install.packges("devtools")
.
library(aelab)
Load other required packages. Install through install.packages("package_name")
if not already installed.
library(readxl) library(tibble) library(lubridate) library(stats) library(dplyr) library(openxlsx)
Unnecessary rows and columns are removed. NaN values of GHG data are removed.
ghg_data_path <- system.file("extdata", "ch4.xlsx", package = "aelab", mustWork = T) ch4 <- tidy_licor(ghg_data_path, "ch4") ch4[c(1:5), ]
Convert the time in LI-COR to match the time in real life (if there are any differences).
ch4 <- convert_time(ch4, min = -15, sec = 30) ch4[c(1:5), ]
Type the date and time of GHG flux measurement (start time) in excel, then load the file into R.
ref_data_path <- system.file("extdata", "reference.xlsx", package = "aelab", mustWork = T) ref <- read_excel(ref_data_path) ref
Calculation of the slope of methane concentration over time using the date_time
value in the ref
data. In the results, start_time
and end_time
are the time range of the data used to perform regression. slope
is the slope and R-square
is the R^2 of the regression. reference_time
is the start time of the measurement from the input.
calculate_regression(ch4, ghg = "CH4", reference_time = ref$date_time)
The default duration of measurement is set to 7
minutes, and the number of rows selected to perform regression is 300
. You can modify these values if desired using the input variables duration_minutes
and num_rows
according to your needs.
calculate_regression(ch4, ghg = "CH4", reference_time = ref$date_time, duration_minutes = 5, num_rows = 300)
The start time of measurement can also be input directly into the function. Note that as.POSIXct()
is necessary.
calculate_regression(ch4, ghg = "CH4", reference_time = as.POSIXct("2023-03-11 07:32:00", tz = "UTC"))
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.