as.data.frame.vp {bioRad}R Documentation

Convert a vertical profile (vp) or time series of vertical profiles (vpts) to a data frame

Description

Converts a vertical profile (vp) or a time series of vertical profiles (vpts) to a data frame containing all quantities per datetime and height. Has options to include latitude/longitude/antenna height (parameter geo) and day/sunrise/sunset (parameter suntime).

Usage

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

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

Arguments

x

A vp or vpts object.

row.names

NULL or a character vector giving the row names for the data frame. Missing values are not allowed. See base::as.data.frame().

optional

Logical. 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. See base::as.data.frame().

geo

Logical. When TRUE, adds latitude (lat), longitude (lon) and antenna height of the radar (height_antenna) to each row.

suntime

Logical. When TRUE, adds whether it is daytime (day) and the datetime of sunrise and sunset to each row.

lat

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

lon

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

elev

Numeric. Sun elevation in degrees, used for sunrise()/sunset() calculations.

...

Additional arguments to be passed to or from methods.

Details

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

Value

A data.frame object, containing radar, datetime and height as rows and all profile quantities as columns, complemented with some oft-used additional information (columns lat, lon, height_antenna, day, sunrise, sunset).

Examples

# Load the example vertical profile
vp <- example_vp

# Convert to a data.frame
vp_df <- as.data.frame(vp)

# Print data.frame
vp_df

# Load the example time series of vertical profiles
vpts <- example_vpts

# Convert to a data.frame
vpts_df <- as.data.frame(vpts)

# Print the first 5 rows of the data.frame
vpts_df[1:5, ]

# Do not add lat/lon/height_antenna information
vpts_df <- as.data.frame(vpts, geo = FALSE)

# Do not add day/sunrise/sunset information
vpts_df <- as.data.frame(vpts, suntime = FALSE)

# Override the latitude/longitude information stored in the object when
# calculating sunrise/sunset information
vpts_df <- as.data.frame(vpts, lat = 50, lon = 4)

[Package bioRad version 0.5.2 Index]