Learn R Programming

weathermetrics (version 1.2.2)

metric_to_inches: Convert between standard metric units of measure for precipitation to inches

Description

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

Usage

metric_to_inches(metric, unit.from, round = 2)

Arguments

metric
Numeric vector of precipitation (in millimeters or centimeters)
unit.from
A character string with the current units of the observations (i.e., the units from which you want to convert)
round
An integer indicating the number of decimal places to round the converted value.

Value

A numeric vector of precipitation in inches.

References

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

See Also

inches_to_metric

Examples

Run this code
data(loveland)
loveland$Precip.in <- metric_to_inches(loveland$Precip.mm,
                                       unit.from = "mm",
                                       round = 2)
loveland

Run the code above in your browser using DataLab