Miscellaneous Functions for Southwest Fisheries Science Center

Collection of conversion, analytical, geodesic, mapping, and plotting functions. Used to support packages and code written by researchers at the Southwest Fisheries Science Center of the National Oceanic and Atmospheric Administration.

CRAN version CRAN last day downloads CRAN last week downloads CRAN last month downloads CRAN total downloads
Travis-CI Build Status AppVeyor Build Status


swfscMisc is a collection of utility functions used at the Southwest Fisheries Science Center in La Jolla, CA. The package contains functions for geodesic calculations, commonly used mapping functions, plotting special symbols, interacting with DAS sighting data generated by the line-transect survey data entry program WinCruz, and miscellaneous analytical and conversion functions.


To install the stable version from CRAN:


To install the latest version from GitHub:

# make sure you have Rtools installed
if (!require('devtools')) install.packages('devtools')
# install from GitHub


Current functions

  • Geodesic functions:

    • bearing
    • datum
    • distance
    • circle.polygon
    • convert.angle
    • convert.distance
  • DAS file functions:

    • das.map
    • das.merge.acoustic
    • das.read
    • das.spp.freq
  • Mapping functions:

    • lat.lon.axes
    • sample.map
  • Plotting functions:

    • braces
    • color.name
    • lab.wid
    • row.col.page.fit
    • scatterdens
    • scatterhist
    • sex.symbols
  • Miscellaneous functions:

    • affin.prop
    • box.area
    • central.quantile
    • copy.tri
    • crossing.point
    • diversity
    • fisher.method.p
    • geometric.mean
    • harmonic.mean
    • isBetween
    • na.count
    • normalize
    • odds conversion (odds, invOdds, logOdds, invLogOdds)
    • one.arg
    • plotAssignments
    • pVal
    • ceiling, floor, trunc, round (.data.frame)
    • uniform.test
    • which.nearest
    • zero.pad

version 1.2 (current on GitHub)

  • Added rounding functions for data.frames.
  • Removed NEWS.md - changelog moved to README.md
  • Added plotAssignments function.

version 1.1

  • Added autoUnits function
  • Changed default arguments for lat.range and lon.range to NULL in sample.map. If not specified, the ranges will be set to the ranges of the lat and lon.

version 1.0.9

  • Added transparent function
  • Changed distance and destination functions to accept partial matches for method of calculation, type of surface, and units

version 1.0.8

  • Fixed das.read to handle errors in position and suppress warnings about NAs during numerical conversions.
  • Fixed das.map to remove records with no position

version 1.0.7

  • Changed isBetween to accept a vector of numbers

version 1.0.6

  • Added NEWS.md
  • Added diversity function (moved from strataG package)
  • Added isBetween function to test if a number is between two numbers


swfscMisc 1.0.6

  • Added NEWS.md
  • Added 'diversity' function (moved from strataG package)
  • Added 'isBetween' function to test if a number is between two numbers
  • Updated README.md
  • Fixed 'zero.pad' to pad to largest integer.

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.


1.5 by Eric Archer, 5 months ago


Report a bug at https://github.com/EricArcher/swfscMisc/issues

Browse source code at https://github.com/cran/swfscMisc

Authors: Eric Archer [aut, cre]

Documentation:   PDF Manual  

GPL (>= 2) license

Imports graphics, grDevices, dplyr, ggplot2, ggrepel, kknn, mapdata, magrittr, tibble, maps, rlang, sf, spatstat.geom, stats, tidyr, utils

Imported by HDSpatialScan, abmR, banter, rfPermute, sprex, swfscAirDAS, swfscDAS.

See at CRAN