Learn R Programming

bioRad (version 0.5.1)

as.data.frame.vpts: Convert a time series of vertical profiles (vpts) to a data frame

Description

Converts vertical profile time series (objects of class vpts) to a data Frame, and optionally adds information on sunrise/sunset, day/night and derived quantities like migration traffic rates.

Usage

# S3 method for vpts
as.data.frame(
  x,
  row.names = NULL,
  optional = FALSE,
  quantities = names(x$data),
  suntime = TRUE,
  geo = TRUE,
  elev = -0.268,
  lat = NULL,
  lon = NULL,
  ...
)

Arguments

x

An object of class vpts.

row.names

NULL or a character vector giving the row names for the data frame. Missing values are not allowed.

optional

If FALSE then the names of the variables in the data frame are checked to ensure that they are syntactically valid variable names and are not duplicated.

quantities

An optional character vector with the names of the quantities to include as columns in the data frame.

suntime

Logical, when TRUE, adds sunrise/sunset and day/night information to each row.

geo

Logical, when TRUE, adds latitude, longitude and antenna height of the radar to each row.

elev

Sun elevation in degrees, see sunrise/sunset.

lat

Radar latitude in decimal degrees. When set, overrides the latitude stored in x in sunrise/sunset calculations.

lon

Radar longitude in decimal degrees. When set, overrides the longitude stored in x in sunrise/sunset calculations.

...

Additional arguments to be passed to or from methods.

Value

An object of class data.frame.

Details

Note that only the 'dens' quantity is thresholded for radial velocity standard deviation by sd_vvp_threshold. Note that this is different from the default plot.vp, plot.vpts and get_quantity.vp functions, where quantities "eta", "dbz", "ff", "u", "v", "w", "dd" are all thresholded by sd_vvp_threshold.

Examples

Run this code
# NOT RUN {
# load an example vertical profile time series object
data(example_vpts)
example_vpts

# convert the object to a data.frame
df <- as.data.frame(example_vpts)

# do not compute sunrise/sunset information
df <- as.data.frame(example_vpts, suntime = FALSE)

# override the latitude/longitude information stored in the object
# when calculating sunrise / sunset
df <- as.data.frame(example_vpts, suntime = TRUE, lat = 50, lon = 4)

# print first then rows of data.frame to console:
df[1:10, ]
# }

Run the code above in your browser using DataLab