save_records: Save GPS data to .csv

Description Usage Arguments Details Value Examples

Description

Saves objects created by get_messages and simplify_cattle to a .csv file.

Usage

1
save_records(x, folder)

Arguments

x

a dataframe object created by simplify_cattle. Can also be used for other dataframes with a SentFromDevice field.

folder

destination folder.

Details

Saves out .csv file from GPS data obtained using get_messages and then passed to simplify_cattle, and includes a check that an output file was created.

Value

Writes out csv file to destination folder with file name of the format: <device>_yyyy-mm-dd_HH_MM_SS_.csv

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
library(dplyr)

tenant <- <tenant>
username <- <username>
password <- <password>

device_list <- get_devices(
tenant, username, password
)

# Must create "my folder" first

df <- get_messages(
device = device_list[1],
tenant = tenant,
username = username,
password = password
) %>%
simplify_cattle(
device = device_list[1]
) %>%
save_records(
"my_folder"
)

print(df)

maupson/gapAPI documentation built on May 21, 2019, 1:37 p.m.