convert_units: convert_units() Converts the values of a vector (colname) or...

View source: R/fct_helpers.R

convert_unitsR Documentation

convert_units() Converts the values of a vector (colname) or a direct value (data) given its starting and end unit. conversion tables are defined in utils_helpers.R

Description

convert_units() Converts the values of a vector (colname) or a direct value (data) given its starting and end unit. conversion tables are defined in utils_helpers.R

Usage

convert_units(data, colnames = NULL, unit_from, unit_to)

Arguments

data

the dataframe containing the columns where to convert units

colnames

the colnames where to convert units. If multiple are provided they will all be converted the same

unit_from

the unit to convert from

unit_to

the unit to convert to. Choice between "kWh", "MWh", "GWh", "TJ"

Value

the same dataframe with updated units on target colnames


vdes2020/eneRgyVD documentation built on July 3, 2025, 7:36 p.m.