View source: R/report_gfdata.R
| report_gfdata | R Documentation | 
Generates a PDF report of preliminary and finalized 'GreenFeed' data. The report includes: number of animals using 'GreenFeed' and plots with distribution of records and gas production. If the preliminary option is used, the data is retrieved from the 'C-Lock Inc.' server through an 'API', otherwise the data processed by 'C-Lock Inc.' must be provided to generate the report.
| input_type | a character string representing type of data (options: "preliminary" and "finalized") | 
| exp | a character string representing study name or other study identifier. It is used as file name to save the data | 
| unit | numeric or character vector, or a list representing one or more 'GreenFeed' unit numbers | 
| start_date | a character string representing the start date of the study (format: "DD-MM-YY" or "YYYY-MM-DD") | 
| end_date | a character string representing the end date of the study (format: "DD-MM-YY" or "YYYY-MM-DD") | 
| save_dir | a character string representing the directory to save the output file | 
| plot_opt | a character string representing the gas(es) to plot (options: "All", "CH4", "CO2", "O2", "H2") | 
| rfid_file | a character string representing the file with individual IDs. The order should be Visual ID (col1) and RFID (col2) | 
| user | a character string representing the user name to logging into 'GreenFeed' system. If input_type is "final", this parameter is ignored | 
| pass | a character string representing password to logging into 'GreenFeed' system. If input_type is "final", this parameter is ignored | 
| file_path | A list of file paths containing the final report(s) from the 'GreenFeed' system. If input_type is "prelim", this parameter is ignored | 
A CSV file with preliminary 'GreenFeed' data and a PDF report with a description of the preliminary or finalized data
# Please replace "your_username" and "your_password" with your actual 'GreenFeed' credentials.
# The data range must be fewer than 180 days
# Example without rfid_file (by default NA)
report_gfdata(
  user = "your_username",
  pass = "your_password",
  input_type = "preliminary",
  exp = "StudyName",
  unit = 1,
  start_date = "2023-01-01",
  end_date = Sys.Date(),
  save_dir = tempdir(),
  plot_opt = "All"
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.