Skip to content

GMBog/greenfeedr

Repository files navigation

greenfeedr

CRAN Status CRAN Downloads CRAN Downloads

Overview

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

Citation

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.

Installation

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")

Recommended workflow

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
)

ShinyApp

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.

Tutorials

Step-by-step guides for common workflows:

Cheat Sheet

Getting help

If you encounter a bug, please file an issue with a minimal reproducible example on GitHub.

For questions or feedback, contact Guillermo Martinez-Boggio.

About

An R Package for Processing & Reporting GreenFeed Data

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages