Summarize number of sightings and animals for selected species by segment
Usage
airdas_effort_sight(x.list, sp.codes, sp.events = c("S", "t"))Arguments
- x.list
list; output of
airdas_effort()- sp.codes
character; species code(s) to include in segdata. These code(s) will be converted to lower case to match
airdas_sight()behavior, and so in practice these codes are case-insensitive- sp.events
character; event code(s) to include in the sightinfo output. This argument supersedes the 'included' value when determining whether a sighting is included in the segment summaries. Must be one or more of: "S", "t" (case-sensitive). The default is that all of these event codes are kept
Value
A list, identical to x.list except for
the nSI and ANI columns added to
x.list$segdata, one each for each element ofsp.codes, andthe included column of
x.list$sightinfo, which has been set asFALSEfor sightings of species not listed insp.codes
Details
This function takes the output of airdas_effort() and
adds columns for the number of sightings (nSI) and number of animals (ANI)
for selected species (selected via sp.codes) for each segment
to the segdata element of x.list.
However, only sightings with an included value of TRUE
(included is a column in sightinfo) are included in the summaries.
Having this step separate from airdas_effort() allows users to
personalize the included values as desired for their analysis.
Examples
y <- system.file("extdata", "airdas_sample.das", package = "swfscAirDAS")
y.proc <- airdas_process(y)
y.cond <- airdas_effort(
y.proc, method = "condition", conditions = "Bft", seg.min.km = 0.05,
num.cores = 1
)
airdas_effort_sight(y.cond, sp.codes = c("mn", "bm"))
#> $segdata
#> segnum section_id section_sub_id event transect file stlin
#> 1 1 1 1 T T1 airdas_sample.das 3
#> 2 2 1 2 T T1 airdas_sample.das 36
#> 3 3 2 1 R T1 airdas_sample.das 40
#> 4 4 2 2 R T1 airdas_sample.das 44
#> 5 5 3 1 T T2 airdas_sample.das 53
#> 6 6 3 2 T T2 airdas_sample.das 78
#> endlin lat1 lon1 DateTime1 lat2 lon2
#> 1 36 39.23550 -123.1563 2015-04-09 12:30:59 39.23400 -123.4033
#> 2 37 39.23400 -123.4033 2015-04-09 12:37:57 39.23400 -123.4047
#> 3 44 39.23400 -123.4742 2015-04-09 12:40:00 39.23317 -123.5143
#> 4 49 39.23317 -123.5143 2015-04-09 12:41:08 39.23283 -123.6032
#> 5 78 39.22000 -123.6078 2015-04-09 12:46:51 39.21683 -123.3605
#> 6 88 39.21683 -123.3605 2015-04-09 12:54:04 39.21700 -123.2418
#> DateTime2 mlat mlon mDateTime dist year month
#> 1 2015-04-09 12:37:57 39.23309 -123.2797 2015-04-09 12:34:28 21.2882 2015 4
#> 2 2015-04-09 12:38:00 39.23400 -123.4040 2015-04-09 12:37:58 0.1148 2015 4
#> 3 2015-04-09 12:41:08 39.23323 -123.4942 2015-04-09 12:40:34 3.4595 2015 4
#> 4 2015-04-09 12:43:43 39.23245 -123.5588 2015-04-09 12:42:25 7.6620 2015 4
#> 5 2015-04-09 12:54:04 39.21667 -123.4842 2015-04-09 12:50:27 21.3146 2015 4
#> 6 2015-04-09 12:57:30 39.21700 -123.3011 2015-04-09 12:55:47 10.2336 2015 4
#> day mtime maxdistBft nSI_bm ANI_bm nSI_mn ANI_mn
#> 1 9 12:34:28 1 2 9 5 23
#> 2 9 12:37:58 2 0 0 0 0
#> 3 9 12:40:34 2 0 0 0 0
#> 4 9 12:42:25 1 0 0 1 3
#> 5 9 12:50:27 1 2 7 1 6
#> 6 9 12:55:47 2 0 0 2 12
#>
#> $sightinfo
#> segnum mlat mlon Event DateTime Lat Lon
#> 1 1 39.23309 -123.2797 S 2015-04-09 12:31:35 39.23367 -123.1783
#> 2 1 39.23309 -123.2797 S 2015-04-09 12:31:47 39.23350 -123.1857
#> 3 1 39.23309 -123.2797 S 2015-04-09 12:31:56 39.23333 -123.1917
#> 4 1 39.23309 -123.2797 S 2015-04-09 12:32:20 39.23233 -123.2053
#> 5 1 39.23309 -123.2797 S 2015-04-09 12:32:30 39.23233 -123.2108
#> 6 1 39.23309 -123.2797 S 2015-04-09 12:32:42 39.23233 -123.2195
#> 7 1 39.23309 -123.2797 S 2015-04-09 12:32:42 39.23233 -123.2195
#> 8 1 39.23309 -123.2797 S 2015-04-09 12:33:43 39.23333 -123.2550
#> 9 1 39.23309 -123.2797 S 2015-04-09 12:35:13 39.23317 -123.3073
#> 10 1 39.23309 -123.2797 S 2015-04-09 12:36:13 39.23333 -123.3418
#> 11 1 39.23309 -123.2797 S 2015-04-09 12:36:26 39.23350 -123.3500
#> 12 1 39.23309 -123.2797 t 2015-04-09 12:36:26 39.23350 -123.3500
#> 13 1 39.23309 -123.2797 S 2015-04-09 12:36:43 39.23350 -123.3592
#> 14 1 39.23309 -123.2797 S 2015-04-09 12:37:01 39.23400 -123.3697
#> 15 1 39.23309 -123.2797 S 2015-04-09 12:37:16 39.23433 -123.3790
#> 16 1 39.23309 -123.2797 S 2015-04-09 12:37:37 39.23417 -123.3910
#> 17 4 39.23245 -123.5588 S 2015-04-09 12:42:13 39.23250 -123.5515
#> 18 5 39.21667 -123.4842 S 2015-04-09 12:51:40 39.21750 -123.4410
#> 19 5 39.21667 -123.4842 S 2015-04-09 12:51:55 39.21750 -123.4317
#> 20 5 39.21667 -123.4842 S 2015-04-09 12:52:03 39.21733 -123.4270
#> 21 5 39.21667 -123.4842 S 2015-04-09 12:52:04 39.21733 -123.4270
#> 22 5 39.21667 -123.4842 S 2015-04-09 12:52:07 39.21733 -123.4258
#> 23 5 39.21667 -123.4842 S 2015-04-09 12:52:17 39.21700 -123.4185
#> 24 5 39.21667 -123.4842 S 2015-04-09 12:52:54 39.21700 -123.3982
#> 25 6 39.21700 -123.3011 S 2015-04-09 12:54:34 39.21667 -123.3422
#> 26 6 39.21700 -123.3011 S 2015-04-09 12:55:20 39.21700 -123.3172
#> 27 6 39.21700 -123.3011 S 2015-04-09 12:56:49 39.21717 -123.2685
#> OnEffort Trans Bft CCover Jelly HorizSun VertSun HKR Haze Kelp RedTide
#> 1 TRUE T1 1 10 0 6 NA n FALSE FALSE FALSE
#> 2 TRUE T1 1 10 0 6 NA n FALSE FALSE FALSE
#> 3 TRUE T1 1 10 0 6 NA n FALSE FALSE FALSE
#> 4 TRUE T1 1 10 0 6 NA n FALSE FALSE FALSE
#> 5 TRUE T1 1 10 0 6 NA n FALSE FALSE FALSE
#> 6 TRUE T1 1 10 0 6 NA n FALSE FALSE FALSE
#> 7 TRUE T1 1 10 0 6 NA n FALSE FALSE FALSE
#> 8 TRUE T1 1 10 0 6 NA n FALSE FALSE FALSE
#> 9 TRUE T1 1 10 2 6 NA r FALSE FALSE TRUE
#> 10 TRUE T1 1 10 2 6 NA r FALSE FALSE TRUE
#> 11 TRUE T1 1 10 2 6 NA r FALSE FALSE TRUE
#> 12 TRUE T1 1 10 2 6 NA r FALSE FALSE TRUE
#> 13 TRUE T1 1 10 2 6 NA r FALSE FALSE TRUE
#> 14 TRUE T1 1 10 2 6 NA r FALSE FALSE TRUE
#> 15 TRUE T1 1 10 2 6 NA r FALSE FALSE TRUE
#> 16 TRUE T1 1 10 2 6 NA r FALSE FALSE TRUE
#> 17 TRUE T1 1 20 0 6 NA n FALSE FALSE FALSE
#> 18 TRUE T2 1 20 0 12 NA n FALSE FALSE FALSE
#> 19 TRUE T2 1 20 0 12 NA n FALSE FALSE FALSE
#> 20 TRUE T2 1 20 0 12 NA n FALSE FALSE FALSE
#> 21 TRUE T2 1 20 0 12 NA n FALSE FALSE FALSE
#> 22 TRUE T2 1 20 0 12 NA n FALSE FALSE FALSE
#> 23 TRUE T2 1 20 0 12 NA n FALSE FALSE FALSE
#> 24 TRUE T2 1 20 0 12 NA n FALSE FALSE FALSE
#> 25 TRUE T2 2 20 0 12 NA n FALSE FALSE FALSE
#> 26 TRUE T2 2 20 0 12 NA n FALSE FALSE FALSE
#> 27 TRUE T2 2 20 0 12 NA r FALSE FALSE TRUE
#> AltFt SpKnot ObsL ObsB ObsR Rec ObsLR ObsRR VLI VLO VB VRI VRO EffortDot
#> 1 650 100 aa bb cc dd <NA> <NA> g g g g g TRUE
#> 2 650 100 aa bb cc dd <NA> <NA> g g g g g TRUE
#> 3 650 100 aa bb cc dd <NA> <NA> g g g g g TRUE
#> 4 650 100 aa bb cc dd <NA> <NA> g g g g g TRUE
#> 5 650 100 aa bb cc dd <NA> <NA> g g g g g TRUE
#> 6 650 100 aa bb cc dd <NA> <NA> g g g g g TRUE
#> 7 650 100 aa bb cc dd <NA> <NA> g g g g g TRUE
#> 8 650 100 aa bb cc dd <NA> <NA> g g g g g TRUE
#> 9 650 100 aa bb cc dd <NA> <NA> g g g g g TRUE
#> 10 650 100 aa bb cc dd <NA> <NA> g g g g g TRUE
#> 11 650 100 aa bb cc dd <NA> <NA> g g g g g TRUE
#> 12 650 100 aa bb cc dd <NA> <NA> g g g g g TRUE
#> 13 650 100 aa bb cc dd <NA> <NA> g g g g g TRUE
#> 14 650 100 aa bb cc dd <NA> <NA> g g g g g TRUE
#> 15 650 100 aa bb cc dd <NA> <NA> g g g g g TRUE
#> 16 650 100 aa bb cc dd <NA> <NA> g g g g g TRUE
#> 17 650 100 aa bb cc dd <NA> <NA> g g g g g TRUE
#> 18 680 90 aa dd cc bb <NA> <NA> g g g g g TRUE
#> 19 680 90 aa dd cc bb <NA> <NA> g g g g g TRUE
#> 20 680 90 aa dd cc bb <NA> <NA> g g g g g TRUE
#> 21 680 90 aa dd cc bb <NA> <NA> g g g g g TRUE
#> 22 680 90 aa dd cc bb <NA> <NA> g g g g g TRUE
#> 23 680 90 aa dd cc bb <NA> <NA> g g g g g TRUE
#> 24 680 90 aa dd cc bb <NA> <NA> g g g g g TRUE
#> 25 680 90 aa dd cc bb <NA> <NA> g g p g g TRUE
#> 26 680 90 aa dd cc bb <NA> <NA> g g p g g TRUE
#> 27 680 90 aa dd cc bb <NA> <NA> g g p g g TRUE
#> EventNum file_das line_num file_type SightNo Obs Angle ObsStd
#> 1 9 airdas_sample.das 9 turtle 1 cc 67 TRUE
#> 2 10 airdas_sample.das 10 turtle 2 bb -60 TRUE
#> 3 12 airdas_sample.das 12 turtle 3 cc 38 TRUE
#> 4 14 airdas_sample.das 14 turtle 4 aa -50 TRUE
#> 5 15 airdas_sample.das 15 turtle 5 cc 49 TRUE
#> 6 16 airdas_sample.das 16 turtle 6 cc 42 TRUE
#> 7 16 airdas_sample.das 16 turtle 6 cc 42 TRUE
#> 8 18 airdas_sample.das 19 turtle 7 aa -53 TRUE
#> 9 23 airdas_sample.das 24 turtle 8 dd 24 FALSE
#> 10 26 airdas_sample.das 27 turtle 9 aa -57 TRUE
#> 11 27 airdas_sample.das 28 turtle 10 cc 65 TRUE
#> 12 28 airdas_sample.das 29 turtle <NA> aa -20 TRUE
#> 13 29 airdas_sample.das 30 turtle 11 bb 87 TRUE
#> 14 31 airdas_sample.das 32 turtle 12 bb 82 TRUE
#> 15 32 airdas_sample.das 33 turtle 13 bb 54 TRUE
#> 16 34 airdas_sample.das 35 turtle 14 cc 62 TRUE
#> 17 46 airdas_sample.das 47 turtle 15 bb 50 TRUE
#> 18 65 airdas_sample.das 66 turtle 16 aa -31 TRUE
#> 19 66 airdas_sample.das 67 turtle 17 bb -59 FALSE
#> 20 68 airdas_sample.das 69 turtle 18 aa -62 TRUE
#> 21 69 airdas_sample.das 70 turtle 19 cc 42 TRUE
#> 22 70 airdas_sample.das 71 turtle 20 aa -48 TRUE
#> 23 71 airdas_sample.das 72 turtle 21 cc 63 TRUE
#> 24 73 airdas_sample.das 74 turtle 22 cc 43 TRUE
#> 25 78 airdas_sample.das 79 turtle 23 cc 56 TRUE
#> 26 80 airdas_sample.das 81 turtle 24 cc 37 TRUE
#> 27 84 airdas_sample.das 85 turtle 25 bb -76 FALSE
#> SightStd Mixed SpCode GsTotal GsSp TurtleSize TurtleDirection TurtleTail
#> 1 TRUE FALSE mn 6 6 NA NA <NA>
#> 2 TRUE FALSE mn 6 6 NA NA <NA>
#> 3 TRUE FALSE mn 2 2 NA NA <NA>
#> 4 TRUE FALSE mn 5 5 NA NA <NA>
#> 5 TRUE FALSE bm 4 4 NA NA <NA>
#> 6 TRUE TRUE gg 10 8 NA NA <NA>
#> 7 TRUE TRUE er 10 2 NA NA <NA>
#> 8 TRUE FALSE bm 5 5 NA NA <NA>
#> 9 FALSE FALSE bm 2 2 NA NA <NA>
#> 10 TRUE FALSE mn 4 4 NA NA <NA>
#> 11 TRUE FALSE gg 5 5 NA NA <NA>
#> 12 TRUE FALSE dc 1 1 5 90 n
#> 13 TRUE FALSE pp 3 3 NA NA <NA>
#> 14 TRUE FALSE gg 5 5 NA NA <NA>
#> 15 TRUE FALSE pp 6 6 NA NA <NA>
#> 16 TRUE FALSE gg 2 2 NA NA <NA>
#> 17 TRUE FALSE mn 3 3 NA NA <NA>
#> 18 TRUE FALSE mn 6 6 NA NA <NA>
#> 19 FALSE FALSE bm 6 6 NA NA <NA>
#> 20 TRUE FALSE gg 2 2 NA NA <NA>
#> 21 TRUE FALSE bm 3 3 NA NA <NA>
#> 22 TRUE FALSE bm 4 4 NA NA <NA>
#> 23 TRUE FALSE pp 6 6 NA NA <NA>
#> 24 TRUE FALSE pp 2 2 NA NA <NA>
#> 25 TRUE FALSE mn 6 6 NA NA <NA>
#> 26 TRUE FALSE mn 6 6 NA NA <NA>
#> 27 FALSE FALSE pp 1 1 NA NA <NA>
#> included
#> 1 TRUE
#> 2 TRUE
#> 3 TRUE
#> 4 TRUE
#> 5 TRUE
#> 6 FALSE
#> 7 FALSE
#> 8 TRUE
#> 9 FALSE
#> 10 TRUE
#> 11 FALSE
#> 12 FALSE
#> 13 FALSE
#> 14 FALSE
#> 15 FALSE
#> 16 FALSE
#> 17 TRUE
#> 18 TRUE
#> 19 FALSE
#> 20 FALSE
#> 21 TRUE
#> 22 TRUE
#> 23 FALSE
#> 24 FALSE
#> 25 TRUE
#> 26 TRUE
#> 27 FALSE
#>
#> $randpicks
#> NULL
#>