Huh / collar

Utilities for exploring telemetry data
Other
7 stars 9 forks source link

Function to parse header and add desired information to data #5

Open Huh opened 6 years ago

Huh commented 6 years ago

The headers of some of the data sets contain useful information, such as the collar serial number. We need a function to pull out the desired information from the headers. An example csv might look like...

Product Type: Lifecycle Pro 500,,,,,,,
Product ID: 100892,,,,,,,
Firmware Version: V8.77.0,,,,,,,
,,,,,,,
GMT Time,Latitude,Longitude,Altitude,Duration,Temperature,DOP,Satellites

The function should be able to take a user input such as "Product ID" and return the value without the subsequent commas.

my_data %>%
  slice(which(grepl(pattern_to_find, .[,1]))) %>%
  ....?