Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build 2024.04.05 #23

Merged
merged 1 commit into from
Apr 7, 2024
Merged
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
@@ -1,7 +1,7 @@
Package: GAPsurvey
Type: Package
Title: Provides at-sea data management tools for RACE GAP surveys
Version: 2024.04.04
Version: 2024.04.05
License: GPL-3
Authors@R:
c(person(given = "Emily",
Expand Down
Binary file added GAPsurvey_2024.04.05.tar.gz
Binary file not shown.
6 changes: 3 additions & 3 deletions R/functions.R
Original file line number Diff line number Diff line change
Expand Up @@ -1021,9 +1021,9 @@ get_catch_haul_history <- function(

# Helper Functions ------------------------------------------------------------------------

#' Takes a string of words and combines them into a sentance that lists them.
#' Takes a string of words and combines them into a sentence that lists them.
#'
#' This function alows you to take a string of words and combine them into a sentance list. For example, 'apples', 'oranges', 'pears' would become 'apples, oranges, and pears'. This function uses oxford commas.
#' This function allows you to take a string of words and combine them into a sentence list. For example, 'apples', 'oranges', 'pears' would become 'apples, oranges, and pears'. This function uses oxford commas.
#' @param x Character strings you want in your string.
#' @param oxford T/F: would you like to use an oxford comma? Default = TRUE
#' @param sep string. default = "," but ";" might be what you need!
Expand All @@ -1048,7 +1048,7 @@ text_list<-function(x, oxford = TRUE, sep = ",") {
return(str1)
}

#' Make numbers the same length preceeded by 0s
#' Make numbers the same length preceded by 0s
#'
#' @param x a single or vector of values that need to be converted from something like 1 to "001"
#' @param number_places default = NA. If equal to NA, the function will take use the longest length of a value provided in x (example 1). If equal to a number, it will make sure that every number is the same length of number_places (example 2) or larger (if a value of x has more places than number_places(example 3)).
Expand Down
5 changes: 4 additions & 1 deletion R/hex_to_cnv.R
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,10 @@ convert_ctd_btd <- function(filepath_hex,
quote = FALSE,
row.names = FALSE)

message(paste0("Baththermic data (.BTD) and header (.BTD) files written to: ", dirpath_output))
message(paste0("Baththermic data (.BTD) and header (.BTD) files written to: \n",
filename,
".BTD\n",
filename, ".BTH"))

}

Expand Down
30 changes: 15 additions & 15 deletions R/public_data.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#' @title Presence-only public data from FOSS
#' @description These datasets, FOSS_CATCH, FOSS_CPUE_PRESONLY, FOSS_HAUL, and FOSS_SPECIES, when full joined by the HAULJOIN variable, includes zero-filled (presence and absence) observations and catch-per-unit-effort (CPUE) estimates for all identified species at for index stations. These tables were created by the Resource Assessment and Conservation Engineering Division (RACE) Groundfish Assessment Program (GAP) of the Alaska Fisheries Science Center (AFSC). There are legal restrictions on access to the data. These data are not intended for public dissemination and should not be shared without the explicit written consent of the data managers and owners (NOAA Fisheries). The GitHub repository for the scripts that created this code can be found at https://github.com/afsc-gap-products/gap_products. For more information about codes used in the tables, please refer to the survey code books (https://www.fisheries.noaa.gov/resource/document/groundfish-survey-species-code-manual-and-data-codes-manual). These data were last updated March 04, 2024.
#' @description
#' @usage data('public_data')
#' @author Emily Markowitz (Emily.Markowitz AT noaa.gov)
#' @format A data frame with 939197 observations on the following 37 variables.
Expand All @@ -12,18 +12,6 @@
#' \item{\code{cpue_nokm2}}{Number CPUE (no/km2). Numerical catch per unit effort (area swept by the net, units square kilometers).}
#' \item{\code{cruise}}{Cruise Name. This is a six-digit integer identifying the cruise number of the form: YYYY99 (where YYYY = year of the cruise; 99 = 2-digit number and is sequential; 01 denotes the first cruise that vessel made in this year, 02 is the second, etc.).}
#' \item{\code{cruisejoin}}{Cruise ID. Unique integer ID assigned to each survey, vessel, and year combination.}
#' \item{\code{date_time}}{Date and time. The date (MM/DD/YYYY) and time (HH:MM) of the haul. All dates and times are in Alaska time (AKDT) of Anchorage, AK, USA (UTC/GMT -8 hours).}
#' \item{\code{depth_m}}{Depth (m). Bottom depth (meters).}
#' \item{\code{distance_fished_km}}{Distance fished (km). Distance the net fished (thousands of kilometers).}
#' \item{\code{duration_hr}}{Tow duration (decimal hr). This is the elapsed time between start and end of a haul (decimal hours).}
#' \item{\code{haul}}{Haul number. This number uniquely identifies a sampling event (haul) within a cruise. It is a sequential number, in chronological order of occurrence.}
#' \item{\code{hauljoin}}{Haul ID. This is a unique numeric identifier assigned to each (vessel, cruise, and haul) combination.}
#' \item{\code{id_rank}}{Lowest taxonomic rank. Lowest taxonomic rank of a given species entry.}
#' \item{\code{itis}}{Integrated taxonomic information system (ITIS) serial number. Species code as identified in the Integrated Taxonomic Information System (https://itis.gov/).}
#' \item{\code{latitude_dd_end}}{End latitude (decimal degrees). Latitude (one hundred thousandth of a decimal degree) of the end of the haul.}
#' \item{\code{latitude_dd_start}}{Start latitude (decimal degrees). Latitude (one hundred thousandth of a decimal degree) of the start of the haul.}
#' \item{\code{longitude_dd_end}}{End longitude (decimal degrees). Longitude (one hundred thousandth of a decimal degree) of the end of the haul.}
#' \item{\code{longitude_dd_start}}{Start longitude (decimal degrees). Longitude (one hundred thousandth of a decimal degree) of the start of the haul.}
#' \item{\code{net_height_m}}{Net height (m). Measured or estimated distance (meters) between footrope and headrope of the trawl.}
#' \item{\code{net_width_m}}{Net width (m). Measured or estimated distance (meters) between wingtips of the trawl.}
#' \item{\code{performance}}{Haul performance code. This denotes what, if any, issues arose during the haul. For more information, review the [code books](https://www.fisheries.noaa.gov/resource/document/groundfish-survey-species-code-manual-and-data-codes-manual).}
Expand All @@ -34,13 +22,25 @@
#' \item{\code{stratum}}{Stratum ID. RACE database statistical area for analyzing data. Strata were designed using bathymetry and other geographic and habitat-related elements. The strata are unique to each survey region. Stratum of value 0 indicates experimental tows.}
#' \item{\code{surface_temperature_c}}{Surface temperature (degrees Celsius). Surface temperature (tenths of a degree Celsius); NA indicates removed or missing values.}
#' \item{\code{survey}}{Survey name. Name and description of survey. The column 'survey' is associated with the 'srvy' and 'survey_definition_id' columns.}
#' \item{\code{survey_definition_id}}{Survey ID. The survey definition ID key code uniquely identifies a survey/survey design. The column 'survey_definition_id' is associated with the 'srvy' and 'survey' columns. For a complete list of surveys, review the [code books](https://www.fisheries.noaa.gov/resource/document/groundfish-survey-species-code-manual-and-data-codes-manual).}
#' \item{\code{survey_definition_id}}{Survey ID. The survey definition ID key code uniquely identifies a survey/survey design. Integer code that uniquely identifies survey. Full list of survey definition IDs are in RACE_DATA.SURVEY_DEFINITIONS. IDs used in GAP_PRODUCTS are: 47 (Gulf of Alaska); 52 (Aleutian Islands); 78 (Bering Sea Slope); 98 (Eastern Bering Sea Shelf); 143 (Northern Bering Sea Shelf). The column 'survey_definition_id' is associated with the 'srvy' and 'survey' columns. For a complete list of surveys, review the [code books](https://www.fisheries.noaa.gov/resource/document/groundfish-survey-species-code-manual-and-data-codes-manual).}
#' \item{\code{taxon_confidence}}{Taxon confidence rating. Confidence in the ability of the survey team to correctly identify the taxon to the specified level, based solely on identification skill (e.g., not likelihood of a taxon being caught at that station on a location-by-location basis). Quality codes follow: **'High'**: High confidence and consistency. Taxonomy is stable and reliable at this level, and field identification characteristics are well known and reliable. **'Moderate'**: Moderate confidence. Taxonomy may be questionable at this level, or field identification characteristics may be variable and difficult to assess consistently. **'Low'**: Low confidence. Taxonomy is incompletely known, or reliable field identification characteristics are unknown. Documentation: [Species identification confidence in the eastern Bering Sea shelf survey (1982-2008)](http://apps-afsc.fisheries.noaa.gov/Publications/ProcRpt/PR2009-04.pdf), [Species identification confidence in the eastern Bering Sea slope survey (1976-2010)](http://apps-afsc.fisheries.noaa.gov/Publications/ProcRpt/PR2014-05.pdf), and [Species identification confidence in the Gulf of Alaska and Aleutian Islands surveys (1980-2011)](http://apps-afsc.fisheries.noaa.gov/Publications/ProcRpt/PR2014-01.pdf).}
#' \item{\code{vessel_id}}{Vessel ID. ID number of the vessel used to collect data for that haul. The column 'vessel_id' is associated with the 'vessel_name' column. Note that it is possible for a vessel to have a new name but the same vessel id number. For a complete list of vessel ID key codes, review the [code books](https://www.fisheries.noaa.gov/resource/document/groundfish-survey-species-code-manual-and-data-codes-manual).}
#' \item{\code{vessel_name}}{Vessel name. Name of the vessel used to collect data for that haul. The column 'vessel_name' is associated with the 'vessel_id' column. Note that it is possible for a vessel to have a new name but the same vessel id number. For a complete list of vessel ID key codes, review the [code books](https://www.fisheries.noaa.gov/resource/document/groundfish-survey-species-code-manual-and-data-codes-manual).}
#' \item{\code{weight_kg}}{Sample or taxon weight (kg). Weight (thousandths of a kilogram) of individuals in a haul by taxon.}
#' \item{\code{worms}}{World register of marine species (WoRMS) taxonomic serial number. Species code as identified in the World Register of Marine Species (WoRMS) (https://www.marinespecies.org/).}
#' \item{\code{year}}{Survey year. Year the observation (survey) was collected.}#' }
#' \item{\code{year}}{Survey year. Year the observation (survey) was collected.}
#' \item{\code{date_time}}{Date and time. The date (MM/DD/YYYY) and time (HH:MM) of the haul. All dates and times are in Alaska time (AKDT) of Anchorage, AK, USA (UTC/GMT -8 hours).}
#' \item{\code{depth_m}}{Depth (m). Bottom depth (meters).}
#' \item{\code{distance_fished_km}}{Distance fished (km). Distance the net fished (thousands of kilometers).}
#' \item{\code{duration_hr}}{Tow duration (decimal hr). This is the elapsed time between start and end of a haul (decimal hours).}
#' \item{\code{haul}}{Haul number. This number uniquely identifies a sampling event (haul) within a cruise. It is a sequential number, in chronological order of occurrence.}
#' \item{\code{hauljoin}}{Haul ID. This is a unique numeric identifier assigned to each (vessel, cruise, and haul) combination.}
#' \item{\code{id_rank}}{Lowest taxonomic rank. Lowest taxonomic rank of a given species entry.}
#' \item{\code{itis}}{Integrated taxonomic information system (ITIS) serial number. Species code as identified in the Integrated Taxonomic Information System (https://itis.gov/).}
#' \item{\code{latitude_dd_end}}{End latitude (decimal degrees). Latitude (one hundred thousandth of a decimal degree) of the end of the haul.}
#' \item{\code{latitude_dd_start}}{Start latitude (decimal degrees). Latitude (one hundred thousandth of a decimal degree) of the start of the haul.}
#' \item{\code{longitude_dd_end}}{End longitude (decimal degrees). Longitude (one hundred thousandth of a decimal degree) of the end of the haul.}
#' \item{\code{longitude_dd_start}}{Start longitude (decimal degrees). Longitude (one hundred thousandth of a decimal degree) of the start of the haul.}#' }
#' @source https://github.com/afsc-gap-products/gap_products and https://www.fisheries.noaa.gov/foss/f?p=215:28:14951401791129:::::
#' @keywords species code data
#' @examples
Expand Down
6 changes: 3 additions & 3 deletions R/station_coords.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
#' @author Sean Rohan (sean.rohan AT noaa.gov)
#' @format A data frame with 31594 observations on the following 4 variables.
#' \describe{
#' \item{\code{latitude_dd}}{Latitude (decimal degrees). Latitude (one hundred thousandth of a decimal degree).}
#' \item{\code{longitude_dd}}{Longitude (decimal degrees). Longitude (one hundred thousandth of a decimal degree).}
#' \item{\code{srvy}}{Survey abbreviation. Abbreviated survey names. The column 'srvy' is associated with the 'survey' and 'survey_definition_id' columns. Northern Bering Sea (NBS), Southeastern Bering Sea (EBS), Bering Sea Slope (BSS), Gulf of Alaska (GOA), Aleutian Islands (AI).}
#' \item{\code{station}}{Station ID. Alpha-numeric designation for the station established in the design of a survey.}#' }
#' \item{\code{station}}{Station ID. Alpha-numeric designation for the station established in the design of a survey.}
#' \item{\code{latitude_dd}}{Latitude (decimal degrees). Latitude (one hundred thousandth of a decimal degree).}
#' \item{\code{longitude_dd}}{Longitude (decimal degrees). Longitude (one hundred thousandth of a decimal degree).}#' }
#' @source https://github.com/afsc-gap-products/akgfmaps
#' @keywords station survey data
#' @examples
Expand Down
23 changes: 12 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ for citing the package created and maintained in this repo. Add “note =

This package was last produced using:

#> R version 4.3.1 (2023-06-16 ucrt)
#> R version 4.3.2 (2023-10-31 ucrt)
#> Platform: x86_64-w64-mingw32/x64 (64-bit)
#> Running under: Windows 10 x64 (build 19045)
#>
Expand All @@ -75,18 +75,19 @@ This package was last produced using:
#> [1] stats4 stats graphics grDevices utils datasets methods base
#>
#> other attached packages:
#> [1] badger_0.2.3 gapindex_2.1.3 pkgdown_2.0.7 readr_2.1.5 magrittr_2.0.3 akgfmaps_3.5.0 terra_1.7-71 stars_0.6-4 abind_1.4-5 gstat_2.1-1 classInt_0.4-10 gapctd_2.1.2 lubridate_1.9.3 plotly_4.10.4 sf_1.0-16 interp_1.1-6 bbmle_1.0.25.1 oce_1.8-2
#> [19] gsw_1.1-1 ggplot2_3.5.0 tidyr_1.3.1 dplyr_1.1.4 plyr_1.8.9 RODBC_1.3-23 roxygen2_7.3.1 devtools_2.4.5 usethis_2.2.3 here_1.0.1
#> [1] badger_0.2.3 pkgdown_2.0.7 gapctd_2.1.2 lubridate_1.9.3 plotly_4.10.4 interp_1.1-6 bbmle_1.0.25.1 oce_1.8-2 gsw_1.1-1 tidyr_1.3.1 plyr_1.8.9 RODBC_1.3-23 roxygen2_7.3.1 devtools_2.4.5 usethis_2.2.3
#> [16] here_1.0.1 akgfmaps_3.5.0 terra_1.7-71 stars_0.6-4 abind_1.4-5 sf_1.0-16 gstat_2.1-1 ggplot2_3.5.0 classInt_0.4-10 gapindex_2.2.0 dplyr_1.1.4 readr_2.1.5 magrittr_2.0.3
#>
#> loaded via a namespace (and not attached):
#> [1] RColorBrewer_1.1-3 sys_3.4.2 rstudioapi_0.16.0 dlstats_0.1.7 jsonlite_1.8.8 rmarkdown_2.26 fs_1.6.3 vctrs_0.6.5 memoise_2.0.1 askpass_1.2.0 gh_1.4.1 htmltools_0.5.8 curl_5.2.1 KernSmooth_2.23-22
#> [15] htmlwidgets_1.6.4 desc_1.4.3 httr2_1.0.1 zoo_1.8-12 cachem_1.0.8 mime_0.12 lifecycle_1.0.4 pkgconfig_2.0.3 Matrix_1.6-5 R6_2.5.1 fastmap_1.1.1 shiny_1.8.1.1 digest_0.6.35 numDeriv_2016.8-1.1
#> [29] colorspace_2.1-0 rprojroot_2.0.4 pkgload_1.3.4 fansi_1.0.6 timechange_0.3.0 httr_1.4.7 compiler_4.3.1 proxy_0.4-27 intervals_0.15.4 remotes_2.5.0 withr_3.0.0 DBI_1.2.2 pkgbuild_1.4.4 MASS_7.3-60.0.1
#> [43] openssl_2.1.1 rappdirs_0.3.3 sessioninfo_1.2.2 tools_4.3.1 units_0.8-5 httpuv_1.6.15 glue_1.7.0 promises_1.2.1 grid_4.3.1 generics_0.1.3 gtable_0.3.4 tzdb_0.4.0 class_7.3-22 data.table_1.15.4
#> [57] hms_1.1.3 sp_2.1-3 xml2_1.3.6 utf8_1.2.4 pillar_1.9.0 stringr_1.5.1 yulab.utils_0.1.4 later_1.3.2 lattice_0.22-6 FNN_1.1.4 deldir_2.0-4 tidyselect_1.2.1 rvcheck_0.2.1 miniUI_0.1.1.1
#> [71] knitr_1.45 gitcreds_0.1.2 xfun_0.43 credentials_2.0.1 stringi_1.8.3 lazyeval_0.2.2 yaml_2.3.8 evaluate_0.23 codetools_0.2-19 tibble_3.2.1 BiocManager_1.30.22 cli_3.6.2 xtable_1.8-4 munsell_0.5.1
#> [85] spacetime_1.3-1 Rcpp_1.0.12 gert_2.0.1 bdsmatrix_1.3-7 parallel_4.3.1 ellipsis_0.3.2 profvis_0.3.8 urlchecker_1.0.1 viridisLite_0.4.2 mvtnorm_1.2-4 scales_1.3.0 xts_0.13.2 e1071_1.7-14 purrr_1.0.2
#> [99] crayon_1.5.2 rlang_1.1.3
#> [1] RColorBrewer_1.1-3 sys_3.4.2 rstudioapi_0.16.0 dlstats_0.1.7 jsonlite_1.8.8 rmarkdown_2.26 fs_1.6.3 vctrs_0.6.5 memoise_2.0.1 askpass_1.2.0 gh_1.4.0 janitor_2.2.0
#> [13] htmltools_0.5.7 curl_5.2.1 KernSmooth_2.23-22 htmlwidgets_1.6.4 keyring_1.3.2 desc_1.4.3 httr2_1.0.0 zoo_1.8-12 cachem_1.0.8 mime_0.12 lifecycle_1.0.4 pkgconfig_2.0.3
#> [25] Matrix_1.6-5 R6_2.5.1 fastmap_1.1.1 shiny_1.8.0 snakecase_0.11.1 digest_0.6.35 numDeriv_2016.8-1.1 colorspace_2.1-0 rprojroot_2.0.4 pkgload_1.3.4 fansi_1.0.6 timechange_0.3.0
#> [37] httr_1.4.7 compiler_4.3.2 proxy_0.4-27 intervals_0.15.4 remotes_2.5.0 withr_3.0.0 DBI_1.2.2 pkgbuild_1.4.4 MASS_7.3-60 openssl_2.1.1 rappdirs_0.3.3 sessioninfo_1.2.2
#> [49] tools_4.3.2 units_0.8-5 httpuv_1.6.14 glue_1.7.0 promises_1.2.1 grid_4.3.2 getPass_0.2-4 generics_0.1.3 gtable_0.3.4 tzdb_0.4.0 class_7.3-22 data.table_1.15.2
#> [61] hms_1.1.3 sp_2.1-3 xml2_1.3.6 utf8_1.2.4 pillar_1.9.0 stringr_1.5.1 yulab.utils_0.1.4 later_1.3.2 lattice_0.21-9 FNN_1.1.4 deldir_2.0-4 tidyselect_1.2.1
#> [73] rvcheck_0.2.1 miniUI_0.1.1.1 knitr_1.45 gitcreds_0.1.2 xfun_0.42 credentials_2.0.1 stringi_1.8.3 lazyeval_0.2.2 yaml_2.3.8 evaluate_0.23 codetools_0.2-19 tibble_3.2.1
#> [85] BiocManager_1.30.22 cli_3.6.2 xtable_1.8-4 munsell_0.5.0 spacetime_1.3-1 Rcpp_1.0.12 gert_2.0.1 bdsmatrix_1.3-7 parallel_4.3.2 ellipsis_0.3.2 assertthat_0.2.1 profvis_0.3.8
#> [97] urlchecker_1.0.1 viridisLite_0.4.2 mvtnorm_1.2-4 scales_1.3.0 xts_0.13.2 e1071_1.7-14 purrr_1.0.2 crayon_1.5.2 rlang_1.1.3

## NOAA README

Expand Down
Binary file modified data/public_data.rda
Binary file not shown.
Binary file modified data/species_data.rda
Binary file not shown.
Binary file modified data/station_coords.rda
Binary file not shown.
Loading
Loading