Skip to contents

This function takes one or more lotek txt files and turns them into an sf collection of points. If there are multiple versions of the same fix record, duplicates will be removed by default. Only the duplicate from the most recent file is kept.

Usage

read_lotek(files, ids = NULL, remove_duplicates = TRUE, show_col_types = FALSE)

Arguments

files

Input files. This can be a path to a single file, a character vector of paths to multiple files, or a list of paths to multiple files.

ids

the device id #s. by default this comes from the filename. Note that shiny file input will change filenames, so this field must be used in that case.

remove_duplicates

if `FALSE`, duplicate records are included in the output

show_col_types

Passed to readr functions. Useful for debugging.

input_crs

reference system used for interpreting coords from file

output_crs

reference system for output spatial df

tz

timezone string to convert timezone processing

Examples

points = read_lotek(system.file("lotek/PinPoint33452.txt", package="beastr"))
summary(points)
#>   device_id             Index          Status              Sats          
#>  Length:468         Min.   :  1.0   Length:468         Length:468        
#>  Class :character   1st Qu.:117.8   Class :character   Class :character  
#>  Mode  :character   Median :234.5   Mode  :character   Mode  :character  
#>                     Mean   :234.5                                        
#>                     3rd Qu.:351.2                                        
#>                     Max.   :468.0                                        
#>                                                                          
#>    RTC-date           RTC-time          FIX-date           FIX-time       
#>  Length:468         Length:468        Length:468         Length:468       
#>  Class :character   Class1:hms        Class :character   Class1:hms       
#>  Mode  :character   Class2:difftime   Mode  :character   Class2:difftime  
#>                     Mode  :numeric                       Mode  :numeric   
#>                                                                           
#>                                                                           
#>                                                                           
#>     Delta(s)       Altitude(m)        HDOP              eRes       
#>  Min.   :-8.321   Min.   :1306   Min.   :  1.100   Min.   :0.0000  
#>  1st Qu.:-2.788   1st Qu.:1856   1st Qu.:  1.975   1st Qu.:0.1000  
#>  Median :-1.806   Median :2153   Median :  3.000   Median :0.3000  
#>  Mean   :-1.862   Mean   :2018   Mean   :  7.805   Mean   :0.7391  
#>  3rd Qu.:-1.013   3rd Qu.:2190   3rd Qu.:  5.575   3rd Qu.:1.0000  
#>  Max.   : 1.412   Max.   :2271   Max.   :285.000   Max.   :5.6000  
#>                   NA's   :164    NA's   :164       NA's   :164     
#>  Temperature(C)    Voltage(V)     Ingest_Time                 
#>  Min.   : 0.00   Min.   :3.750   Min.   :2022-05-10 09:00:37  
#>  1st Qu.:16.50   1st Qu.:3.800   1st Qu.:2022-05-10 09:00:37  
#>  Median :20.50   Median :3.800   Median :2022-05-10 09:00:37  
#>  Mean   :22.57   Mean   :3.821   Mean   :2022-05-10 09:00:37  
#>  3rd Qu.:32.00   3rd Qu.:3.850   3rd Qu.:2022-05-10 09:00:37  
#>  Max.   :38.00   Max.   :3.850   Max.   :2022-05-10 09:00:37  
#>                                                               
#>           geometry        time                    
#>  POINT        :468   Min.   :2021-11-23 21:38:46  
#>  epsg:32611   :  0   1st Qu.:2021-11-26 16:41:47  
#>  +proj=utm ...:  0   Median :2021-11-28 22:08:06  
#>                      Mean   :2021-11-29 01:05:06  
#>                      3rd Qu.:2021-11-30 22:19:23  
#>                      Max.   :2021-12-08 21:00:16  
#>