Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ License: Apache License (== 2)
Encoding: UTF-8
Roxygen: list(markdown = TRUE)
VignetteBuilder: knitr
Config/roxygen2/version: 8.0.0
Config/roxygen2/version: 8.1.0
152 changes: 87 additions & 65 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -59,71 +59,93 @@ export(das_sight)
export(das_spcodes_read)
export(distance_greatcircle)
export(randpicks_convert)
importFrom(dplyr,add_row)
importFrom(dplyr,arrange)
importFrom(dplyr,between)
importFrom(dplyr,bind_cols)
importFrom(dplyr,bind_rows)
importFrom(dplyr,case_when)
importFrom(dplyr,desc)
importFrom(dplyr,distinct)
importFrom(dplyr,everything)
importFrom(dplyr,filter)
importFrom(dplyr,full_join)
importFrom(dplyr,group_by)
importFrom(dplyr,if_else)
importFrom(dplyr,lag)
importFrom(dplyr,left_join)
importFrom(dplyr,mutate)
importFrom(dplyr,n)
importFrom(dplyr,n_distinct)
importFrom(dplyr,reframe)
importFrom(dplyr,right_join)
importFrom(dplyr,select)
importFrom(dplyr,slice)
importFrom(dplyr,starts_with)
importFrom(dplyr,summarise)
importFrom(dplyr,ungroup)
importFrom(lubridate,day)
importFrom(lubridate,month)
importFrom(lubridate,tz)
importFrom(lubridate,year)
importFrom(dplyr,
across,
add_row,
arrange,
between,
bind_cols,
bind_rows,
case_when,
desc,
distinct,
everything,
filter,
full_join,
group_by,
if_else,
lag,
left_join,
mutate,
n,
n_distinct,
pull,
reframe,
right_join,
select,
slice,
starts_with,
summarise,
ungroup
)
importFrom(lubridate,
day,
month,
tz,
year
)
importFrom(magrittr,"%>%")
importFrom(methods,setOldClass)
importFrom(parallel,clusterExport)
importFrom(parallel,detectCores)
importFrom(parallel,parLapplyLB)
importFrom(parallel,stopCluster)
importFrom(purrr,map_chr)
importFrom(purrr,pmap)
importFrom(purrr,pmap_int)
importFrom(purrr,pmap_lgl)
importFrom(readr,col_character)
importFrom(readr,cols)
importFrom(readr,fwf_cols)
importFrom(readr,fwf_positions)
importFrom(readr,read_fwf)
importFrom(rlang,"!!")
importFrom(rlang,.data)
importFrom(sf,st_as_sf)
importFrom(sf,st_cast)
importFrom(sf,st_coordinates)
importFrom(sf,st_geometry)
importFrom(sf,st_intersection)
importFrom(sf,st_intersects)
importFrom(sf,st_linestring)
importFrom(sf,st_polygon)
importFrom(sf,st_sf)
importFrom(sf,st_sfc)
importFrom(sf,st_wrap_dateline)
importFrom(stats,na.omit)
importFrom(stats,runif)
importFrom(swfscMisc,bearing)
importFrom(swfscMisc,destination)
importFrom(swfscMisc,distance)
importFrom(swfscMisc,setupClusters)
importFrom(parallel,
clusterExport,
detectCores,
parLapplyLB,
stopCluster
)
importFrom(purrr,
map_chr,
pmap,
pmap_int,
pmap_lgl
)
importFrom(readr,
col_character,
cols,
fwf_cols,
fwf_positions,
read_fwf
)
importFrom(rlang,
"!!",
.data
)
importFrom(sf,
st_as_sf,
st_cast,
st_coordinates,
st_geometry,
st_intersection,
st_intersects,
st_linestring,
st_polygon,
st_sf,
st_sfc,
st_wrap_dateline
)
importFrom(stats,
na.omit,
runif
)
importFrom(swfscMisc,
bearing,
destination,
distance,
setupClusters
)
importFrom(tidyr,pivot_longer)
importFrom(utils,head)
importFrom(utils,read.csv)
importFrom(utils,tail)
importFrom(utils,write.csv)
importFrom(utils,
head,
read.csv,
tail,
write.csv
)
18 changes: 14 additions & 4 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,28 @@
# swfscDAS 0.7.0.9000

* Fix bug in `das_process` of incorrect OffsetGMT values, stemming from `as.Date` using 'UTC' tz by default (#16)
* Fixed bug in `das_process` of incorrect OffsetGMT values, stemming from `as.Date` using 'UTC' tz by default (#16)

* Fixed bug in `das_segdata` to actually only use the last condition value for a segment of length zero (#27)

* Added an exported function `das_spcodes_read` for consistent reading of shipboard SpCode files

* Changed the argument name in `das_check` of the user-provided SpCodes file from `sp.codes` to `sp.codes.file`. Also added a `sp.codes.skip` argument to pass to `das_spcodes_read`

* Added 'SwellDir' (Event V, Data 3) and 'WindDir' (Event W, Data 4) to the output of `das_process` (#21)

* Changed behavior of `das_effort` when the `seg0.drop` argument is `TRUE`. Now, for segments with distance traveled <=0.1 km, either a) they are dropped if they have no associated sighting events are dropped, or b) if they have associated sightings they are kept and given a distance of 0.1km. This behavior matches historical SWFSC segment chopping logic (#22)

* Added optional argument `gs.sp.min1` to `das_sight`, to allow the user to choose to set the minimum value for all non-NA species group size values to 1. This functionality is important for group size calibration efforts. Users can also specify this argument in `das_effort`, where it is passed to `das_sight` when creating the sightinfo data frame (#26)

* Added 'Trackline' (Event R, Data 3)to the output of `das_process` (#10)

* Moved example data files to an 'extdata' folder within 'inst'

* Update link to NOAA Tech Memo describing DAS data; now (https://repository.library.noaa.gov/view/noaa/3174)[https://repository.library.noaa.gov/view/noaa/3174](#17)
* Update link to NOAA Tech Memo describing DAS data; now [https://repository.library.noaa.gov/view/noaa/3174](#17)

* Update roxygen to use markdown, fix documentation issues related to upgrade to roxygen2 v8.0
* Update roxygen to use markdown, fix documentation issues related to upgrade to roxygen2 v8

* Added the SpCodes.dat file from [`CruzPlot`](https://github.com/SWFSC/CruzPlot) to 'inst' to have available as a default
* Added the SpCodes.dat file (from [`CruzPlot`](https://github.com/SWFSC/CruzPlot)) to 'inst' to have available as a default


# swfscDAS 0.6.4
Expand Down
2 changes: 2 additions & 0 deletions R/as_das_df.R
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ as_das_df.data.frame <- function(x) {
SpdKt = "numeric",
Bft = "numeric",
SwellHght = "numeric",
SwellDir = "numeric",
WindSpdKt = "numeric",
WindDir = "numeric",
RainFog = "numeric",
HorizSun = "numeric",
VertSun = "numeric",
Expand Down
13 changes: 12 additions & 1 deletion R/das_check.R
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,14 @@
#' Echo sounder \tab B \tab Data4 \tab Must be one of Y, N, y, n, or NA (blank) \cr
#' Effort type \tab R \tab Data1 \tab Must be one of F, N, S, or NA (blank) \cr
#' ESW sides \tab R \tab Data2 \tab Effective strip width; must be one of F, H, or NA (blank) \cr
#' Trackline number \tab R \tab Data3 \tab Trackline number, represented as a character \cr
#' Course \tab N \tab Data1 \tab Can be converted to a numeric value \cr
#' Speed \tab N \tab Data2 \tab Can be converted to a numeric value \cr
#' Beaufort \tab V \tab Data1 \tab Must be a whole number between 0 and 9 \cr
#' Swell height \tab V \tab Data2 \tab Can be converted to a numeric value \cr
#' Swell direction \tab V \tab Data3 \tab Can be converted to a numeric value \cr
#' Wind speed \tab V \tab Data5 \tab Can be converted to a numeric value \cr
#' Wind direction \tab W \tab Data4 \tab Can be converted to a numeric value \cr
#' Rain or fog \tab W \tab Data1 \tab Must be between 0 and 5 and either a whole number or have decimal value .5\cr
#' Horizontal sun \tab W \tab Data2 \tab Must be a whole number between 0 and 12 \cr
#' Vertical sun \tab W \tab Data3 \tab Must be a whole number between 0 and 12 \cr
Expand Down Expand Up @@ -336,7 +339,7 @@ das_check <- function(
txt.e.na <- "E events should only have data in the Data1 column"

# R events
idx.r.na <- .check_isna(x, c("R"), paste0("Data", 3:9))
idx.r.na <- .check_isna(x, c("R"), paste0("Data", 4:9))
txt.r.na <- "R events should only have data in the Data1-2 columns"

# N events
Expand Down Expand Up @@ -413,10 +416,18 @@ das_check <- function(
idx.v.2 <- .check_numeric(x, "V", "Data2")
txt.v.2 <- "Swell height (Data2 of V events) cannot be converted to a numeric"

# Swell direction
idx.v.2 <- .check_numeric(x, "V", "Data3")
txt.v.2 <- "Swell direction (Data3 of V events) cannot be converted to a numeric"

# Wind speed
idx.v.5 <- .check_numeric(x, "V", "Data5")
txt.v.5 <- "Wind speed (Data5 of V events) cannot be converted to a numeric"

# Wind direction
idx.v.5 <- .check_numeric(x, "W", "Data4")
txt.v.5 <- "Wind direction (Data4 of W events) cannot be converted to a numeric"

# RainFog
rf.acc <- c(seq(0, 5, by = 0.5), sprintf("%02d", 1:5), NA)
idx.w.1 <- .check_character(x, "W", "Data1", rf.acc)
Expand Down
2 changes: 2 additions & 0 deletions R/das_class.R
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ NULL
#' SpdKt \tab "numeric"\cr
#' Bft \tab "numeric"\cr
#' SwellHght \tab "numeric"\cr
#' SwellDir \tab "numeric"\cr
#' WindSpdKt \tab "numeric"\cr
#' WindDir \tab "numeric"\cr
#' RainFog \tab "numeric"\cr
#' HorizSun \tab "numeric"\cr
#' VertSun \tab "numeric"\cr
Expand Down
Loading
Loading