plotAuralLandscape: Plot an aural landscape from a structured dataset

View source: R/plotAuralLandscape.R

plotAuralLandscapeR Documentation

Plot an aural landscape from a structured dataset

Description

plotAuralLandscape currently does a simple 2-d plot of observations by time of day and day of year. Eventually should have functions to (1) accommodate point observations and ranges, (2) subset by observers and areas, (3) allow for plotting customization.

Usage

plotAuralLandscape(
  x,
  plotType = c("hull", "points"),
  addJitter = FALSE,
  ptSize = 4,
  nullSize = 2,
  legPos = c(0.85, 0.85),
  dateRange = c(1:11),
  timeRange = c(3:22),
  observers = "all",
  obsGrep = TRUE,
  taxa = "all",
  taxaGrep = TRUE,
  addAll = "gray85",
  aggregateYears = TRUE,
  timeAsDecimal = TRUE,
  colorAlpha = 0.6,
  taxonPalette = c("#000000", "#E69F00", "#56B4E9", "#009E73", "#F0E442", "#0072B2",
    "#D55E00", "#CC79A7"),
  showPlot = TRUE
)

Arguments

x

data.frame of observations, with taxon, day, month, year, time (in 24 hr notation)

plotType

not currently implemented

addJitter

Boolean; jitter points for additional visibility?

ptSize

Point size for selected observations

nullSize

Point size for all observations, if addAll = T

legPos

Legend position; if NA, default

dateRange

Vector of months to include

timeRange

Vector of hours to include (24 hr notation)

observers

Character vector of length 1; observers to include, or 'all'

obsGrep

Boolean; use grep with observers?

taxa

Character vector of length 1; taxa to include, or 'all'

taxaGrep

Boolean; use grep with taxa?

addAll

NA or named color; if color, add all obs in background

aggregateYears

Ignore year when plotting, aggregate all dates to yr = 1

timeAsDecimal

Boolean; time is decimal? alternative: H:M (24 hour)

colorAlpha

Transparency of points

taxonPalette

Color palette for taxa; default is color-blind with black

showPlot

Boolean; plot or just return object?

Examples

## data(auralObservations)
## get most recent data:
require(openxlsx)
a <- read.xlsx('https://github.com/andrew-hipp/auralLandscapes/blob/main/data/auralObservations.xlsx?raw=true',
            detectDates=T)
## use this if you are using decimal time:
a$time <- a$time * 24
## use this if you want to convert decimal time to HM:
## Not run: 
  a$time <- format(ISOdatetime(1900,1,1,0,0,0, tz="GMT") +
           as.difftime(a$time, unit="hours"), "%H:%M")

## End(Not run)
out <- plotAuralLandscape(a, taxa = 'robin|cardinal|peeper|chorus')


andrew-hipp/auralLandscapes documentation built on April 4, 2022, 9:40 a.m.