measurements (version 1.5.1)

conv_dim: Convert Dimensions of Measurement

Description

Converts between dimensions of measurement given a transition dimension (the dimension that "bridges" x and y, e.g. liters per second, lbs per acre). Note that 2 of the 3 measurements (x, y, or trans) must be defined to calculate the 3rd. See conv_unit_options for all options.

Usage

conv_dim(x, x_unit, trans, trans_unit, y, y_unit)

Arguments

x

a numeric vector giving the measurement value in the first dimension.

x_unit

the unit in which x was measured.

trans

a numeric vector giving the measurement value in the transition dimension.

trans_unit

the unit in which trans was measured.

y

a numeric vector giving the measurement value in the second dimension.

y_unit

the unit in which y was measured.

Author

Matthew A. Birk, matthewabirk@gmail.com

Details

This function supports all dimensions in conv_unit_options except for coordinates. The conversion values have been defined based primarily from international weight and measurement authorities (e.g. General Conference on Weights and Measures, International Committee for Weights and Measures, etc.). While much effort was made to make conversions as accurate as possible, you should check the accuracy of conversions to ensure that conversions are precise enough for your applications.

See Also

conv_unit_options, conv_unit

Examples

Run this code
# How many minutes does it take to travel 100 meters at 3 feet per second?
conv_dim(x = 100, x_unit = "m", trans = 3, trans_unit = "ft_per_sec", y_unit = "min")

# How many degrees does the temperature increase with an increase in 4 kPa given 0.8 Celcius
# increase per psi?
conv_dim(x_unit = "C", trans = 0.8, trans_unit = "C_per_psi", y = 4, y_unit = "kPa")

# Find the densities given volume and mass measurements.
conv_dim(x = c(60, 80), x_unit = "ft3", trans_unit = "kg_per_l", y = c(6e6, 4e6), y_unit = "g")

Run the code above in your browser using DataLab