process_rfid_data: Process RFID Data

View source: R/utils.R

process_rfid_dataR Documentation

Process RFID Data

Description

Processes RFID data from animals in the study.

Usage

process_rfid_data(rfid_file)

Arguments

rfid_file

Path or data frame containing RFID data.

Value

A data frame with standardized column names ('FarmName' and 'RFID'). If the input is invalid or if no valid data is provided, the function returns 'NULL'.

Examples

# Example with a data frame
df <- data.frame(
  V1 = c("Farm1", "Farm2", "Farm3"),
  V2 = c("12345", "67890", "54321")
)
processed_df <- process_rfid_data(df)
message(processed_df)

# Example with invalid input
invalid_data <- process_rfid_data(NULL)
# Expected output: message "RFID is NA. It is recommended to include it." and NULL
message(invalid_data)

# Example with unsupported file format
# Assuming 'rfid_data.docx' is an unsupported file format
invalid_file <- process_rfid_data("path/to/rfid_data.docx")
# Expected output: error message "Unsupported file format."
message(invalid_file)


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