CovsXVisit: CovsXVisit

CovsXVisitR Documentation

CovsXVisit

Description

Produces a Covariate X Visit matrix for use in analyses

Usage

CovsXVisit(
  object,
  covs,
  parks = NA,
  points = NA,
  years = NA,
  times = NA,
  visits = NA,
  reps = NA,
  output = "dataframe"
)

Arguments

object

A data.frame, NCRNbirds object or a list of such objects. If the input is a data.frame in should be in the same format at the ouptut of getVisits

covs

A character vector of one or more covariate names. Options inlcude:

"day"

Provides the Julian day (aka ordinal day) for each visit.

"humidity"

Provides the humidity measured for each visit.

"observer"

Provides the observer for each visit.

"sky"

Provides the sky condiiton (e.g. Clear, Cloudy, Fog etc.) for each visit.

"temp"

Provides the temperature for each visit.

"decibel"

Provides the backround noise level in decibels.

"time"

Provides the time of day when each visit began. This is expressed in minutes since the start of the day.

"visit"

Indicates if a visit occurred or not. Each visit column will either have the visit number if a visit occured or NA if it did not.

"wind"

Provides the wind level for each visit (e.g. Calm, Light breeze).

"fyear"

Provdes the year as a factor for each visit.

"nyear

Provides the centered year for each visit.

parks

A character vector of park codes. Only data from these parks will be returned.

points

A character vector of point names. Only data from these points will be returned.

years

A numeric vector. Returns data only from points where the years the point was visited matches one of the values in years. The year a visit takes place is determined by the Year column in the visits slot which is derived from the information in the EventDate column.

times

A numeric vector of length 1. Returns only data from points where the number of years that a point has been vistied is greater or equal to the value of times. This is determined based on the data found in the Visits slot.

visits

A length 1 numeric vector, defaults to NA. Returns data only from the indicated visits.

reps

A length 1 numeric vector,defaults to NA. Returns only data from points and years where the point has been visited at least reps times in the year.

output

Either "dataframe" (the default) or "list". Note that this must be in quotes. Determines the type of output from the function.

Details

This produces a Covariate(s) X Visit matrix for a NCRNbirds object or a list of such objects. Each row of the matrix will correspond to a different point in a different year. The columns of the matrix will be the park code, the point name, the year visited, and a column for each covariate at each visit. These columns will be called "Day1", "Day2" or "Humidity1", "Humidity2" etc. to indicate the covariate and the visit.

If visits is left as NA then the visits used will be 1 through the number of visits indicated in the visits slot. Otherwise a numeric vector e.g. c(1,2) can be used to select which visits are used.

If the input object is an NCRNbirds object or a list of such objects, the function will use the getVisits function to retrieve the visit data. Currently if you supply a data.frame as the object the filtering by parks, points etc. will not occur, all visits present in the input data.frame will be present it the ouput data.frame


NCRN/NCRNbirds documentation built on Aug. 28, 2023, 12:12 p.m.