extract_TK | R Documentation |
In societal exergy analysis, converting heat to exergy requires knowledge
of the temperature of that heat.
This function converts heat types (e.g., "HTH.600.C
")
to temperatures by extracting the temperature (in Kelvin) from the middle of the string.
extract_TK(heat_types, sep = ".")
heat_types |
a string vector of heat types to be converted to temperatures |
sep |
the separator between parts of the |
It is assumed that the heat type has the following structure:
a single letter (typically, "H", "M", or "L" for high, medium, or low, although the character doesn't matter)
the string "TH." or "TC." (for "temperature heating" or "temperature cooling"),
the temperature value, and
unit (one of ".C", ".F", ".R", or ".K", indicating ° Celsius, ° Fahrenheit, rankine, or kelvin, respectively).
If heat_type
does not conform to the pattern shown above, NA
is the likely result.
a numeric vector of same length as heat_types
containing temperatures in Kelvin.
extract_TK(c("HTH.600.C", "LTH.-20.567.C", "LTH.-40.F", "LTH.-40.C"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.