process_gfdata: Process Preliminary and Finalized 'GreenFeed' Data

View source: R/process_gfdata.R

process_gfdataR Documentation

Process Preliminary and Finalized 'GreenFeed' Data

Description

Processes and calculates daily and weekly averages of 'GreenFeed' data. Handles data filtering, aggregation, and summarization to facilitate further analysis.

Arguments

data

a data frame with preliminary or finalized 'GreenFeed' data

start_date

a character string representing the start date of the study (format: "dmy")

end_date

a character string representing the end date of the study (format: "dmy")

param1

an integer representing the number of records per day to be consider for analysis

param2

an integer representing the number of days with records per week to be consider for analysis

min_time

an integer representing the minimum number of minutes for a records to be consider for analysis (default: 2 minutes)

cutoff

an integer specifying the range for identifying outliers (default: 3 SD)

Value

A list of three data frames:

filtered_data

data frame with filtered 'GreenFeed' data

daily_data

data frame with daily processed 'GreenFeed' data

weekly_data

data frame with weekly processed 'GreenFeed' data

Examples

file <- system.file("extdata", "StudyName_GFdata.csv", package = "greenfeedr")
datafile <- readr::read_csv(file)

gf_data <- process_gfdata(
  data = datafile,
  start_date = "2024-05-13",
  end_date = "2024-05-25",
  param1 = 2,
  param2 = 3,
  min_time = 2
)
head(gf_data)


greenfeedr documentation built on April 4, 2025, 12:22 a.m.