greenfeedr is an R package to easily download, process, and report GreenFeed data.
| Function | Description |
|---|---|
get_gfdata() |
Download GreenFeed data via the C-Lock API |
process_gfdata() |
Process GreenFeed records into daily and weekly estimates, with automatic or manual parameter selection |
report_gfdata() |
Generate summary reports of 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.
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 how records are aggregated —
specifically, the minimum number of records per day (param1) and the
minimum number of days per week (param2).
process_gfdata() handles this automatically. By default, it evaluates
all parameter combinations, performs a diurnal analysis, and selects the
combination that maximises the composite repeatability (ICC) of emission
estimates while retaining at least 80% of study animals. The selected
parameters, repeatability statistics, and a ready-to-paste methods
sentence are printed to the console.
Automatic mode (recommended):
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"
)
processed <- process_gfdata(
data = data,
start_date = "2024-05-13",
end_date = "2024-05-20"
)The function prints the selected parameters and their repeatability, and attaches the full optimisation table and diurnal analysis to the output for inspection:
attr(processed, "optimization") # full parameter grid results
attr(processed, "diurnal")$plot # diurnal emission curveManual mode — if you prefer to specify parameters directly:
processed <- process_gfdata(
data = data,
start_date = "2024-05-13",
end_date = "2024-05-20",
param1 = 2,
param2 = 3,
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, processing, and reporting — without writing any code.
Step-by-step guides for common workflows:
- 1. Downloading Data
- 2. Processing Data
- 3. Reporting Data
- 4. Calculating Pellet Intakes
- 5. 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.

