greenfeedr is an R package to easily download, evaluate, process, and report GreenFeed data.
| Function | Description |
|---|---|
get_gfdata() |
Download GreenFeed data via the C-Lock API |
eval_gfparam() |
Evaluate all parameter combinations and select the best filtering settings based on repeatability (ICC) |
process_gfdata() |
Process and average GreenFeed records into daily and weekly estimates |
report_gfdata() |
Generate summary reports of GreenFeed data |
compare_gfdata() |
Compare preliminary and finalized GreenFeed data |
pellin() |
Process pellet intakes from GreenFeed units |
viseat() |
Process and summarize GreenFeed visit patterns |
If you use greenfeedr in your research, please cite:
Martinez-Boggio et al. (2025). greenfeedr: An R package for processing and reporting GreenFeed data. JDS Communications. https://doi.org/10.3168/jdsc.2024-0662
In R, run citation("greenfeedr") to get the formatted reference.
Note: If you use
eval_gfparam()to select filtering parameters, the function automatically prints a ready-to-use methods sentence — including the citation — that you can paste directly into your manuscript.
To install the latest stable release from CRAN:
install.packages("greenfeedr")For the development version with the latest updates:
install.packages("remotes")
remotes::install_github("GMBog/greenfeedr")GreenFeed units record gas emissions during voluntary animal visits.
Because visit frequency varies across animals and days, the reliability
of emission estimates depends on filtering parameters that define the
minimum number of records per day (param1) and the minimum number of
days with records per week (param2). The recommended workflow is:
1. Evaluate parameters — identify the combination that maximizes repeatability of weekly estimates while retaining enough animals:
library(greenfeedr)
data <- get_gfdata(
username = "your_username",
password = "your_password",
unit_id = "your_unit_id",
start_date = "2024-05-13",
end_date = "2024-05-20"
)
eval <- eval_gfparam(
data = data,
start_date = "2024-05-13",
end_date = "2024-05-20",
gas = "CH4"
)The function prints the suggested parameters, their repeatability (ICC), animal retention, and a ready-to-paste methods sentence for your manuscript.
2. Process data using the suggested parameters:
processed <- process_gfdata(
data = data,
start_date = "2024-05-13",
end_date = "2024-05-20",
param1 = 2, # use value suggested by eval_gfparam()
param2 = 3, # use value suggested by eval_gfparam()
min_time = 2
)Prefer a point-and-click interface? Run the interactive ShinyApp directly on your computer:
greenfeedr::run_gfapp()The app covers the full workflow — downloading, evaluating parameters, processing, and reporting — without writing any code.
Step-by-step guides for common workflows:
- 1. Downloading Data
- 2. Evaluating Parameters
- 3. Processing Data
- 4. Reporting Data
- 5. Calculating Pellet Intakes
- 6. Checking Visitation
If you encounter a bug, please file an issue with a minimal reproducible example on GitHub.
For questions or feedback, contact Guillermo Martinez-Boggio.

