DATRASextra 0.4.0
This release focuses on API consistency. Several arguments and function names have been renamed so that naming conventions are uniform across the package (e.g. verbose instead of warn_missing, legend instead of do_legend, write_datras instead of write_exchange). Two new arguments have been added: plus_group in add_total_weight_by_haul() and lw_pars in the weight functions for supplying custom length-weight parameters. The default bin width in add_numbers_at_length() now matches the survey’s native recording resolution instead of always using 1 cm. All renaming changes are breaking; see the detailed entries below.
Breaking changes (API consistency)
prune_datras(): argumentsremove_hlandremove_carenamed todrop_hlanddrop_cato match the verb used bydrop_hl()anddrop_ca(). Argumentwarn_missingrenamed toverbosefor consistency with all other functions.plot_length_distribution()andplot_species_composition(): argumentdo_legendrenamed tolegendfor consistency withplot_datras_overview(),plot_stratified_index(), andplot_spatial_indicators().legend_ncoldefault changed from1Lto1.get_aphia(): first argument renamed fromxtospecies.get_latin(): first argument renamed fromxtoaphia.write_exchange()renamed towrite_datras()for consistency withread_datras().add_swept_area_simple()is no longer exported. Useadd_swept_area()(with defaultmethod = "simple") instead.add_swept_area()output columnSweptArea.medianrenamed toSweptArea_median, for consistency with the underscore naming convention used elsewhere (e.g.SweptArea_imputed).
Breaking changes
check_lengths()andcheck_weights()now return the inputdatras_rawobject invisibly (consistent withcheck_outliers()), instead of a plain list. Results are attached as attributes:attr(x, "length_check")andattr(x, "weight_check"), respectively. Code that assigned the return value to a separate variable (e.g.res <- check_lengths(x)) and then accessedres$lParsshould be updated tox <- check_lengths(x)andattr(x, "length_check")$lPars.The default for
impute_missing_depthinclean_datras()has changed fromTRUEtoFALSE. Enable explicitly withimpute_missing_depth = TRUEif needed (requires themgcvpackage).
Minor changes
add_total_weight_by_haul()gains aplus_groupargument (defaultFALSE), passed through toadd_weight_at_length(). Argument order changed:per_minutemoved to the last position so shared filtering arguments (max_length,max_weight) align withadd_weight_at_length().add_numbers_at_length(): default forbychanged from1toget_accuracy_cm(x), consistent withcheck_lengths()andadd_total_numbers_by_haul(). Surveys recorded at 0.5 cm resolution now use 0.5 cm bins by default.add_weight_at_length()andadd_total_weight_by_haul()gain alw_parsargument for supplying custom length-weight parametersaandbdirectly, without modifying the internalspecies_infotable. Accepts a named vector (c(a = 0.01, b = 3.0)), a named list, or a data frame with columnsaandb. For multi-species objects, a data frame with aValid_Aphia(oraphia) column can be used to supply per-species parameters; species not covered fall back tolw_source.mgcvandicesDatrasare no longer hard dependencies. Both have been removed fromImports;mgcvis now listed underSuggests. The DATRAS API calls previously handled byicesDatrasare now made directly in base R.add_swept_area()(simple method) now reports swept-area missingness and imputation. It adds a per-haul logical columnSweptArea_imputedtoHH, attaches a survey-by-gear summary asattr(x, "swept_area_summary"), and prints it unlessverbose = FALSE. The summary reportsn_imputed/prop_imputedandn_NA/prop_NA, the hauls whose swept area is stillNAafter imputation (e.g. gears that cannot be imputed). A newfull_reportargument (defaultFALSE) additionally reports per-column missingness counts (na_DoorSpread,na_WingSpread,na_Distance,na_HaulDur) of the original input columns.Added the article Matching EMODnet seabed habitats to hauls, showing how to download EUSeaMap polygons from the EMODnet Seabed Habitats WFS and attach a seabed habitat class to each haul in
HHwith a spatial join.Replaced the article Constructing a prediction grid within a survey domain with Building a spatiotemporal prediction grid, which uses the new
make_survey_grid()function to build the grid and add a year dimension.
DATRASextra 0.1.1
New features
New
make_survey_grid()function creates a regular prediction grid from coordinate vectors. Supports any coordinate system, optional pruning of grid nodes by maximum distance to observations (viaRANN), and optional crossing with a time vector.New
spawning_infodataset: a lookup table of spawning months by species and ICES area, including the WoRMS AphiaID for each species.read_datras()gains ancoresargument (default1) for parallel reading of zip files usingparallel::mclapply(). Effective on non-Windows systems; falls back silently to sequential on Windows.
Minor changes
Added vignette Working with datras_raw objects introducing the
datras_raw/DATRASrawclass structure and common workflows.Added the Getting started article The datras_raw object, describing the object structure, indexing, ICES vocabulary lookups, and the numbers- and weight-at-length matrices.
download_datras()gains atimeoutargument (default10seconds). When the ICES DATRAS server does not respond within the given time (e.g. due to firewall restrictions), the function now falls back to cached survey/year information instead of hanging indefinitely. The timeout also applies to the internal survey-list lookup.
Bug fixes
- Fixed
$and$<-dispatch ondatras_rawobjects (#38). TheDATRASpackage defines$.DATRASrawto look insidex[[2]], which was written for an older internal structure and causedx$HHto returnNULLinstead of the HH data frame. New$.datras_rawand$<-.datras_rawmethods intercept dispatch before the broken method is reached: if the name matches a top-level table (CA,HH, orHL) the table is returned or replaced; otherwise the call is routed to the HH data frame, preserving the existing column-shortcut convention used internally (e.g.x$SweptArea <- ...).
DATRASextra 0.1.0
Initial beta release
This is the first beta release of DATRASextra, an R package extending the ICES DATRAS workflow with tools for downloading, processing, cleaning, standardising, and analysing bottom-trawl survey data.
Main features
- Download and import ICES DATRAS survey data
- Read, write, clean, and subset
datras_rawobjects - Reproduce key components of the FishGlob data-processing workflow
- Estimate swept area and standardise haul metrics
- Calculate numbers- and weight-at-length distributions
- Aggregate total numbers and biomass by haul and length group
- Support species harmonisation and WoRMS-based taxonomic information
- Visualise survey structure, catch composition, and length distributions
- Convert DATRAS data into FishGlob-like formats for downstream analyses
