# Read an example Licor file included in the PhotoGEA package
licor_file <- read_gasex_file(
PhotoGEA_example_file_path('c4_aci_1.xlsx')
)
# Define a new column that uniquely identifies each curve
licor_file[, 'species_plot'] <-
paste(licor_file[, 'species'], '-', licor_file[, 'plot'] )
# Organize the data
licor_file <- organize_response_curve_data(
licor_file,
'species_plot',
c(9, 10, 16),
'CO2_r_sp'
)
# Create the guessing function
guessing_func <- initial_guess_c4_aci_hyperbola()
# Apply it and see the initial guesses for each curve
print(by(licor_file, licor_file[, 'species_plot'], guessing_func))
# A simple way to visualize the guesses is to "fit" the curves using the null
# optimizer, which simply returns the initial guess
aci_results <- consolidate(by(
licor_file,
licor_file[, 'species_plot'],
fit_c4_aci_hyperbola,
optim_fun = optimizer_null()
))
plot_c4_aci_hyperbola_fit(aci_results, 'species_plot', ylim = c(-10, 100))
Run the code above in your browser using DataLab