Skip to contents

Read one or more fixed-width aerial survey DAS text file(s) generated by TURTLEP, or another AirDAS program, into a data frame, where each line is data for a specific event

Usage

airdas_read(
  file,
  file.type = c("turtle", "caretta", "survey", "phocoena"),
  skip = 0,
  tz = "UTC",
  ...
)

Arguments

file

filename(s) of one or more AirDAS files

file.type

character; indicates the program used to create file. Must be one of: "turtle", "caretta", "survey", or "phocoena" (case sensitive). Default is "turtle"

skip

integer: see read_fwf. Default is 0

tz

character; see strptime. Default is UTC

...

ignored

Value

An airdas_dfr object, which is also a data frame, with AirDAS data read into columns. The data are read into the data frame as characters, with the following exceptions:

NameClassDetails
EffortDotlogicalTRUE if "." was present, and FALSE otherwise
DateTimePOSIXctcombination of 'Date' and 'Time' columns, with time zone tz
Latnumeric'Latitude' columns converted to decimal degrees in range [-90, 90]
Lonnumeric'Longitude' columns converted to decimal degrees in range [-180, 180]
Data#characterleading/trailing whitespace trimmed for non-comment events (i.e. where 'Event' is not "C" )
file_dascharacterbase filename, extracted from the file argument
line_numintegerline number of each data row
file_typecharacterfile.type argument

Details

Reads/parses aerial survey DAS data into columns of a data frame. If file contains multiple filenames, then the individual data frames will be combined using rbind

See airdas_format_pdf for information about AirDAS format requirements for the specific file types (programs)

Examples

y <- system.file("airdas_sample.das", package = "swfscAirDAS")
airdas_read(y, file.type = "turtle")
#>    Event EffortDot            DateTime      Lat       Lon Data1 Data2 Data3
#> 1      C     FALSE 2015-04-09 12:30:59 39.23550 -123.1563  Reco rder:  dd  
#> 2      C     FALSE 2015-04-09 12:30:59 39.23550 -123.1563  Not  recor ding 
#> 3      T      TRUE 2015-04-09 12:30:59 39.23550 -123.1563    T1  <NA>  <NA>
#> 4      V      TRUE 2015-04-09 12:30:59 39.23550 -123.1563     g     g     g
#> 5      P      TRUE 2015-04-09 12:30:59 39.23550 -123.1563    aa    bb    cc
#> 6      A      TRUE 2015-04-09 12:30:59 39.23550 -123.1563   650   100  <NA>
#> 7      W      TRUE 2015-04-09 12:30:59 39.23550 -123.1563     n    10     1
#> 8      *      TRUE 2015-04-09 12:31:00 39.23567 -123.1575  <NA>  <NA>  <NA>
#> 9      S      TRUE 2015-04-09 12:31:35 39.23367 -123.1783     1    cc    67
#> 10     S      TRUE 2015-04-09 12:31:47 39.23350 -123.1857     2    bb   -60
#> 11     C      TRUE 2015-04-09 12:31:48 39.23350 -123.1857  2 cp  <NA>  <NA>
#> 12     S      TRUE 2015-04-09 12:31:56 39.23333 -123.1917     3    cc    38
#> 13     *      TRUE 2015-04-09 12:32:00 39.23317 -123.1930  <NA>  <NA>  <NA>
#> 14     S      TRUE 2015-04-09 12:32:20 39.23233 -123.2053     4    aa   -50
#> 15     S      TRUE 2015-04-09 12:32:30 39.23233 -123.2108     5    cc    49
#> 16     S      TRUE 2015-04-09 12:32:42 39.23233 -123.2195     6    cc    42
#> 17     1     FALSE                <NA>       NA        NA  <NA>  <NA>  <NA>
#> 18     *      TRUE 2015-04-09 12:33:00 39.23267 -123.2292  <NA>  <NA>  <NA>
#> 19     S      TRUE 2015-04-09 12:33:43 39.23333 -123.2550     7    aa   -53
#> 20     *      TRUE 2015-04-09 12:34:00 39.23300 -123.2637  <NA>  <NA>  <NA>
#> 21     W      TRUE 2015-04-09 12:34:52 39.23317 -123.2945     r    10     1
#> 22     C      TRUE 2015-04-09 12:34:56 39.23317 -123.2968  stre aky r ed ti
#> 23     *      TRUE 2015-04-09 12:35:00 39.23317 -123.2985  <NA>  <NA>  <NA>
#> 24     S      TRUE 2015-04-09 12:35:13 39.23317 -123.3073     8    dd    24
#> 25     C      TRUE 2015-04-09 12:35:32 39.23317 -123.3178  shar k 11f t    
#> 26     *      TRUE 2015-04-09 12:36:00 39.23333 -123.3337  <NA>  <NA>  <NA>
#> 27     S      TRUE 2015-04-09 12:36:13 39.23333 -123.3418     9    aa   -57
#> 28     S      TRUE 2015-04-09 12:36:26 39.23350 -123.3500    10    cc    65
#> 29     t      TRUE 2015-04-09 12:36:26 39.23350 -123.3500    aa   -20    dc
#> 30     S      TRUE 2015-04-09 12:36:43 39.23350 -123.3592    11    bb    87
#> 31     *      TRUE 2015-04-09 12:37:01 39.23383 -123.3685  <NA>  <NA>  <NA>
#> 32     S      TRUE 2015-04-09 12:37:01 39.23400 -123.3697    12    bb    82
#> 33     S      TRUE 2015-04-09 12:37:16 39.23433 -123.3790    13    bb    54
#> 34     #      TRUE 2015-04-09 12:37:17 39.23433 -123.3790  <NA>  <NA>  <NA>
#> 35     S      TRUE 2015-04-09 12:37:37 39.23417 -123.3910    14    cc    62
#> 36     W      TRUE 2015-04-09 12:37:57 39.23400 -123.4033     n    10     2
#> 37     E     FALSE 2015-04-09 12:38:00 39.23400 -123.4047  <NA>  <NA>  <NA>
#> 38     C     FALSE 2015-04-09 12:38:00 39.23400 -123.4047  off  effor t to 
#> 39     *     FALSE 2015-04-09 12:39:00 39.23417 -123.4400  <NA>  <NA>  <NA>
#> 40     R      TRUE 2015-04-09 12:40:00 39.23400 -123.4742  <NA>  <NA>  <NA>
#> 41     W      TRUE 2015-04-09 12:40:28 39.23333 -123.4915     n    20     2
#> 42     C      TRUE 2015-04-09 12:40:36 39.23317 -123.4960  wate r got  more
#> 43     *      TRUE 2015-04-09 12:41:00 39.23317 -123.5092  <NA>  <NA>  <NA>
#> 44     W      TRUE 2015-04-09 12:41:08 39.23317 -123.5143     n    20     1
#> 45     *      TRUE 2015-04-09 12:42:00 39.23267 -123.5433  <NA>  <NA>  <NA>
#> 46     C      TRUE 2015-04-09 12:42:01 39.23267 -123.5433  fb2s  fb1m  <NA>
#> 47     S      TRUE 2015-04-09 12:42:13 39.23250 -123.5515    15    bb    50
#> 48     *      TRUE 2015-04-09 12:43:00 39.23233 -123.5778  <NA>  <NA>  <NA>
#> 49     O     FALSE 2015-04-09 12:43:43 39.23283 -123.6033  <NA>  <NA>  <NA>
#> 50     *     FALSE 2015-04-09 12:44:00 39.23300 -123.6118  <NA>  <NA>  <NA>
#> 51     *     FALSE 2015-04-09 12:45:00 39.24450 -123.6415  <NA>  <NA>  <NA>
#> 52     *     FALSE 2015-04-09 12:46:00 39.22167 -123.6373  <NA>  <NA>  <NA>
#> 53     T      TRUE 2015-04-09 12:46:51 39.22000 -123.6078    T2  <NA>  <NA>
#> 54     V      TRUE 2015-04-09 12:46:51 39.22000 -123.6078     g     g     g
#> 55     P      TRUE 2015-04-09 12:46:51 39.22000 -123.6078    aa    dd    cc
#> 56     A      TRUE 2015-04-09 12:46:51 39.22000 -123.6078   650   100  <NA>
#> 57     W      TRUE 2015-04-09 12:46:51 39.22000 -123.6078     n    20     1
#> 58     *      TRUE 2015-04-09 12:47:00 39.21950 -123.6025  <NA>  <NA>  <NA>
#> 59     *      TRUE 2015-04-09 12:48:00 39.21783 -123.5682  <NA>  <NA>  <NA>
#> 60     A      TRUE 2015-04-09 12:48:29 39.21767 -123.5515   680   100  <NA>
#> 61     A      TRUE 2015-04-09 12:48:36 39.21783 -123.5468   650   100  <NA>
#> 62     *      TRUE 2015-04-09 12:49:00 39.21783 -123.5333  <NA>  <NA>  <NA>
#> 63     *      TRUE 2015-04-09 12:50:00 39.21617 -123.4987  <NA>  <NA>  <NA>
#> 64     A      TRUE 2015-04-09 12:50:32 39.21683 -123.4797   680    90  <NA>
#> 65     *      TRUE 2015-04-09 12:51:00 39.21733 -123.4653  <NA>  <NA>  <NA>
#> 66     S      TRUE 2015-04-09 12:51:40 39.21750 -123.4410    16    aa   -31
#> 67     S      TRUE 2015-04-09 12:51:55 39.21750 -123.4317    17    bb   -59
#> 68     *      TRUE 2015-04-09 12:52:00 39.21733 -123.4293  <NA>  <NA>  <NA>
#> 69     S      TRUE 2015-04-09 12:52:03 39.21733 -123.4270    18    aa   -62
#> 70     S      TRUE 2015-04-09 12:52:04 39.21733 -123.4270    19    cc    42
#> 71     S      TRUE 2015-04-09 12:52:07 39.21733 -123.4258    20    aa   -48
#> 72     S      TRUE 2015-04-09 12:52:17 39.21700 -123.4185    21    cc    63
#> 73     C      TRUE 2015-04-09 12:52:39 39.21700 -123.4072  bell y has  some
#> 74     S      TRUE 2015-04-09 12:52:54 39.21700 -123.3982    22    cc    43
#> 75     *      TRUE 2015-04-09 12:53:00 39.21717 -123.3960  <NA>  <NA>  <NA>
#> 76     *      TRUE 2015-04-09 12:54:00 39.21683 -123.3617  <NA>  <NA>  <NA>
#> 77     V      TRUE 2015-04-09 12:54:01 39.21683 -123.3605     g     g     p
#> 78     W      TRUE 2015-04-09 12:54:04 39.21683 -123.3605     n    20     2
#> 79     S      TRUE 2015-04-09 12:54:34 39.21667 -123.3422    23    cc    56
#> 80     *      TRUE 2015-04-09 12:55:00 39.21667 -123.3285  <NA>  <NA>  <NA>
#> 81     S      TRUE 2015-04-09 12:55:20 39.21700 -123.3172    24    cc    37
#> 82     *      TRUE 2015-04-09 12:56:00 39.21700 -123.2960  <NA>  <NA>  <NA>
#> 83     W      TRUE 2015-04-09 12:56:40 39.21733 -123.2730     r    20     2
#> 84     C      TRUE 2015-04-09 12:56:43 39.21717 -123.2718  patc hy re d tid
#> 85     S      TRUE 2015-04-09 12:56:49 39.21717 -123.2685    25    bb   -76
#> 86     *      TRUE 2015-04-09 12:57:00 39.21700 -123.2617  <NA>  <NA>  <NA>
#> 87     s      TRUE 2015-04-09 12:57:00 39.21700 -123.2617    25   -70  <NA>
#> 88     O     FALSE 2015-04-09 12:57:30 39.21700 -123.2417  <NA>  <NA>  <NA>
#>    Data4 Data5 Data6           Data7 EventNum          file_das line_num
#> 1   <NA>  <NA>  <NA>            <NA>        1 airdas_sample.das        1
#> 2  molas  <NA>  <NA>            <NA>        2 airdas_sample.das        2
#> 3   <NA>  <NA>  <NA>            <NA>        3 airdas_sample.das        3
#> 4      g     g  <NA>            <NA>        4 airdas_sample.das        4
#> 5     dd  <NA>  <NA>            <NA>        5 airdas_sample.das        5
#> 6   <NA>  <NA>  <NA>            <NA>        6 airdas_sample.das        6
#> 7      0     6  <NA>            <NA>        7 airdas_sample.das        7
#> 8   <NA>  <NA>  <NA>            <NA>        8 airdas_sample.das        8
#> 9      6    mn  <NA>            <NA>        9 airdas_sample.das        9
#> 10     6    mn  <NA>            <NA>       10 airdas_sample.das       10
#> 11  <NA>  <NA>  <NA>            <NA>       11 airdas_sample.das       11
#> 12     2    mn  <NA>            <NA>       12 airdas_sample.das       12
#> 13  <NA>  <NA>  <NA>            <NA>       13 airdas_sample.das       13
#> 14     5    mn  <NA>            <NA>       14 airdas_sample.das       14
#> 15     4    bm  <NA>            <NA>       15 airdas_sample.das       15
#> 16    10    gg    er            <NA>       16 airdas_sample.das       16
#> 17  <NA>    80    20            <NA>     <NA> airdas_sample.das       17
#> 18  <NA>  <NA>  <NA>            <NA>       17 airdas_sample.das       18
#> 19     5    bm  <NA>            <NA>       18 airdas_sample.das       19
#> 20  <NA>  <NA>  <NA>            <NA>       19 airdas_sample.das       20
#> 21     2     6  <NA>            <NA>       20 airdas_sample.das       21
#> 22 de     <NA>  <NA>            <NA>       21 airdas_sample.das       22
#> 23  <NA>  <NA>  <NA>            <NA>       22 airdas_sample.das       23
#> 24     2    bm  <NA>            <NA>       23 airdas_sample.das       24
#> 25  <NA>  <NA>  <NA>            <NA>       24 airdas_sample.das       25
#> 26  <NA>  <NA>  <NA>            <NA>       25 airdas_sample.das       26
#> 27     4    mn  <NA>            <NA>       26 airdas_sample.das       27
#> 28     5    gg  <NA>            <NA>       27 airdas_sample.das       28
#> 29     5    90     n            <NA>       28 airdas_sample.das       29
#> 30     3    pp  <NA>            <NA>       29 airdas_sample.das       30
#> 31  <NA>  <NA>  <NA>            <NA>       30 airdas_sample.das       31
#> 32     5    gg  <NA>            <NA>       31 airdas_sample.das       32
#> 33     6    pp  <NA>            <NA>       32 airdas_sample.das       33
#> 34  <NA>  <NA>  <NA>            <NA>       33 airdas_sample.das       34
#> 35     2    gg  <NA>            <NA>       34 airdas_sample.das       35
#> 36     0     6  <NA>            <NA>       35 airdas_sample.das       36
#> 37  <NA>  <NA>  <NA>            <NA>       36 airdas_sample.das       37
#> 38 circl e on  unide ntifed object         37 airdas_sample.das       38
#> 39  <NA>  <NA>  <NA>            <NA>       38 airdas_sample.das       39
#> 40  <NA>  <NA>  <NA>            <NA>       39 airdas_sample.das       40
#> 41     0     6  <NA>            <NA>       40 airdas_sample.das       41
#> 42  blue  <NA>  <NA>            <NA>       41 airdas_sample.das       42
#> 43  <NA>  <NA>  <NA>            <NA>       42 airdas_sample.das       43
#> 44     0     6  <NA>            <NA>       43 airdas_sample.das       44
#> 45  <NA>  <NA>  <NA>            <NA>       44 airdas_sample.das       45
#> 46  <NA>  <NA>  <NA>            <NA>       45 airdas_sample.das       46
#> 47     3    mn  <NA>            <NA>       46 airdas_sample.das       47
#> 48  <NA>  <NA>  <NA>            <NA>       47 airdas_sample.das       48
#> 49  <NA>  <NA>  <NA>            <NA>       48 airdas_sample.das       49
#> 50  <NA>  <NA>  <NA>            <NA>       49 airdas_sample.das       50
#> 51  <NA>  <NA>  <NA>            <NA>       50 airdas_sample.das       51
#> 52  <NA>  <NA>  <NA>            <NA>       51 airdas_sample.das       52
#> 53  <NA>  <NA>  <NA>            <NA>       52 airdas_sample.das       53
#> 54     g     g  <NA>            <NA>       53 airdas_sample.das       54
#> 55    bb  <NA>  <NA>            <NA>       54 airdas_sample.das       55
#> 56  <NA>  <NA>  <NA>            <NA>       55 airdas_sample.das       56
#> 57     0    12  <NA>            <NA>       56 airdas_sample.das       57
#> 58  <NA>  <NA>  <NA>            <NA>       57 airdas_sample.das       58
#> 59  <NA>  <NA>  <NA>            <NA>       58 airdas_sample.das       59
#> 60  <NA>  <NA>  <NA>            <NA>       59 airdas_sample.das       60
#> 61  <NA>  <NA>  <NA>            <NA>       60 airdas_sample.das       61
#> 62  <NA>  <NA>  <NA>            <NA>       61 airdas_sample.das       62
#> 63  <NA>  <NA>  <NA>            <NA>       62 airdas_sample.das       63
#> 64  <NA>  <NA>  <NA>            <NA>       63 airdas_sample.das       64
#> 65  <NA>  <NA>  <NA>            <NA>       64 airdas_sample.das       65
#> 66     6    mn  <NA>            <NA>       65 airdas_sample.das       66
#> 67     6    bm  <NA>            <NA>       66 airdas_sample.das       67
#> 68  <NA>  <NA>  <NA>            <NA>       67 airdas_sample.das       68
#> 69     2    gg  <NA>            <NA>       68 airdas_sample.das       69
#> 70     3    bm  <NA>            <NA>       69 airdas_sample.das       70
#> 71     4    bm  <NA>            <NA>       70 airdas_sample.das       71
#> 72     6    pp  <NA>            <NA>       71 airdas_sample.das       72
#> 73  glar e      <NA>            <NA>       72 airdas_sample.das       73
#> 74     2    pp  <NA>            <NA>       73 airdas_sample.das       74
#> 75  <NA>  <NA>  <NA>            <NA>       74 airdas_sample.das       75
#> 76  <NA>  <NA>  <NA>            <NA>       75 airdas_sample.das       76
#> 77     g     g  <NA>            <NA>       76 airdas_sample.das       77
#> 78     0    12  <NA>            <NA>       77 airdas_sample.das       78
#> 79     6    mn  <NA>            <NA>       78 airdas_sample.das       79
#> 80  <NA>  <NA>  <NA>            <NA>       79 airdas_sample.das       80
#> 81     6    mn  <NA>            <NA>       80 airdas_sample.das       81
#> 82  <NA>  <NA>  <NA>            <NA>       81 airdas_sample.das       82
#> 83     0    12  <NA>            <NA>       82 airdas_sample.das       83
#> 84 e      <NA>  <NA>            <NA>       83 airdas_sample.das       84
#> 85     1    pp  <NA>            <NA>       84 airdas_sample.das       85
#> 86  <NA>  <NA>  <NA>            <NA>       85 airdas_sample.das       86
#> 87  <NA>  <NA>  <NA>            <NA>       86 airdas_sample.das       87
#> 88  <NA>  <NA>  <NA>            <NA>       87 airdas_sample.das       88
#>    file_type
#> 1     turtle
#> 2     turtle
#> 3     turtle
#> 4     turtle
#> 5     turtle
#> 6     turtle
#> 7     turtle
#> 8     turtle
#> 9     turtle
#> 10    turtle
#> 11    turtle
#> 12    turtle
#> 13    turtle
#> 14    turtle
#> 15    turtle
#> 16    turtle
#> 17    turtle
#> 18    turtle
#> 19    turtle
#> 20    turtle
#> 21    turtle
#> 22    turtle
#> 23    turtle
#> 24    turtle
#> 25    turtle
#> 26    turtle
#> 27    turtle
#> 28    turtle
#> 29    turtle
#> 30    turtle
#> 31    turtle
#> 32    turtle
#> 33    turtle
#> 34    turtle
#> 35    turtle
#> 36    turtle
#> 37    turtle
#> 38    turtle
#> 39    turtle
#> 40    turtle
#> 41    turtle
#> 42    turtle
#> 43    turtle
#> 44    turtle
#> 45    turtle
#> 46    turtle
#> 47    turtle
#> 48    turtle
#> 49    turtle
#> 50    turtle
#> 51    turtle
#> 52    turtle
#> 53    turtle
#> 54    turtle
#> 55    turtle
#> 56    turtle
#> 57    turtle
#> 58    turtle
#> 59    turtle
#> 60    turtle
#> 61    turtle
#> 62    turtle
#> 63    turtle
#> 64    turtle
#> 65    turtle
#> 66    turtle
#> 67    turtle
#> 68    turtle
#> 69    turtle
#> 70    turtle
#> 71    turtle
#> 72    turtle
#> 73    turtle
#> 74    turtle
#> 75    turtle
#> 76    turtle
#> 77    turtle
#> 78    turtle
#> 79    turtle
#> 80    turtle
#> 81    turtle
#> 82    turtle
#> 83    turtle
#> 84    turtle
#> 85    turtle
#> 86    turtle
#> 87    turtle
#> 88    turtle