Learn R Programming

weathermetrics (version 1.2.2)

inches_to_metric: Convert from inches to standard metric units of measure for precipitation

Description

inches_to_metric creates a numeric vector of precipitation in common metric units (millimeters or centimeters) from a numeric vector of precipitation in inches.

Usage

inches_to_metric(inches, unit, round = 2)

Arguments

inches
Numeric vector of precipitation (in inches)
unit
Character specifying the metric precipitation unit besides inches. Possible values are:
  • mm: Millimeters
  • cm: Centimeters
round
An integer indicating the number of decimal places to round the converted value.

Value

A numeric vector of precipitation (in specified metric unit)

References

http://www.srh.noaa.gov/ama/?n=conversions

See Also

metric_to_inches

Examples

Run this code
data(breck)
breck$Precip.mm <- inches_to_metric(breck$Precip.in,
                                    unit = "mm",
                                    round = 2)
breck

Run the code above in your browser using DataLab