knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
First, let's grab my most recent observations:
library(auralLandscapes) require(openxlsx) require(magrittr) 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
The data are organized by taxon, time, date, with additional optional fields that are currently ignored:
names(a)
At this point, you only have to have the three columns taxon
, date
, and time
in your spreadsheet. Any others are gravy. If you have your own data in an Excel spreadsheet in xlsx format, you can read it in using read.xlsx
with detectDates = T
, and then multiply the decimal times by 24 to get hours that make sense. This is a bit of a kludge, and other formats don't currently work so well. Note two bits of formatting fussiness:
At the outset, it might be useful to investigate how many taxa you have observed:
a$taxon %>% unique %>% sort a$taxon %>% unique %>% sort %>% length
... and probably double-check for orthographic errors (e.g., including both "cardinal" and "cardinals", or both "white-throated sparrow" and "white throated sparrow"). These can be corrected manually or on the fly; I would recommend cleaning up your data first b/f plotting rather than creating code to clean it on the fly.
Then, consider which observations you have the most of:
a$taxon %>% table %>% sort(decreasing = TRUE)
Once you've done some of this preliminary work, the question is what aspects of your aural landscape you want to explore.
First, the herps:
aur.herps <- plotAuralLandscape(a, taxa = 'american toad|peeper|chorus')
Then, robins and cardinals:
aur.robCard <- plotAuralLandscape(a, taxa = 'robin|cardinal')
A range of suburban birds, excluding robins and cardinals:
aur.suburbs <- plotAuralLandscape(a, taxa = 'chickadee|wren|goldfinch|dove')
The leading edge of a few bird-harbingers of spring:
aur.harbingers <- plotAuralLandscape(a, taxa = 'blackbird|song sparrow|black-throated|woodcock', dateRange = 2:5, legPos = NA, colorAlpha = 1.0)
How about the morning songs of very early spring:
aur.springMornings <- plotAuralLandscape(a, taxa = 'robin|dove|chorus|peeper|woodcock|cardinal|song sparrow', dateRange = 1:4, timeRange = c(4:6), legPos = NA, colorAlpha = 1.0)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.