get_gfdata | R Documentation |
Downloads preliminary and raw 'GreenFeed' data from the 'C-Lock Inc.' server via an 'API'. Retrieves data based on specified parameters (login, date range, and units), and provides a CSV file with the 'GreenFeed' preliminary data.
get_gfdata(
user,
pass,
d = "visits",
exp = NA,
unit,
start_date,
end_date = Sys.Date(),
save_dir = tempdir()
)
user |
a character string representing the user name to logging into 'GreenFeed' system |
pass |
a character string representing password to logging into 'GreenFeed' system |
d |
a character string representing data type to download (opts: "visits", "feed", "rfid", "cmds") |
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: "dmy") |
end_date |
a character string representing the end date of the study (format: "dmy") |
save_dir |
a character string representing the directory to save the output file |
A CSV file with the specified data (visits or raw) saved in the provided directory.
# Please replace "your_username" and "your_password" with your actual 'GreenFeed' credentials.
# By default, the function downloads the preliminary 'GreenFeed' data,
# if raw data is needed use options: "feed", "rfid", or "cmds"
get_gfdata(
user = "your_username",
pass = "your_password",
d = "visits",
exp = "StudyName",
unit = c(304, 305),
start_date = "2024-01-01",
end_date = Sys.Date(),
save_dir = tempdir()
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.