# Create an exdf object by reading a Licor Excel file
licor_file <- read_gasex_file(
PhotoGEA_example_file_path('ball_berry_1.xlsx')
)
# Print the number of points in the data set
nrow(licor_file)
# Remove the following:
# - All points where `obs` is 28 (1 point)
# - All points where `species` is `soybean` and `plot` is `1a` or `1b` (14 points)
licor_file_2 <- remove_points(
licor_file,
list(obs = 28),
list(species = 'soybean', plot = c('1a', '1b')),
method = 'remove'
)
# There should now be 15 fewer points remaining in the data set
nrow(licor_file_2)
# We can also specify the same points for exclusion rather than removal:
licor_file_3 <- remove_points(
licor_file,
list(obs = 28),
list(species = 'soybean', plot = c('1a', '1b')),
method = 'exclude'
)
print(licor_file_3[, c('species', 'plot', 'include_when_fitting')])
# The number of points where `include_when_fitting` is TRUE should be the same
# as the number of remaining rows when using the `remove` method
sum(licor_file_3[, 'include_when_fitting'])
Run the code above in your browser using DataLab