construction_decimal_eng: Construction Decimal Engineering (LibreCAD Style)

construction_decimal_engR Documentation

Construction Decimal Engineering (LibreCAD Style)

Description

Convert a construction measurement in US Customary Units (foot + inch) with or without a fraction into its equivalent as an Engineering value (LibreCAD style)

Usage

construction_decimal_eng(measurement)

Arguments

measurement

character or numeric vector that contains the construction measurement (decimal or foot + inch)

Value

the engineering construction measurement value as a character vector. In LibreCAD, a construction measurement of 1'-2 7/16" = 14.43112 (decimal) = 1'-2.43112" (engineering).

Author(s)

Irucka Embry, R. van Twisk (rs_units.cpp code)

Source

regex - Replace single backslash in R - Stack Overflow answered and edited by Hong Ooi on Aug 21, 2014. (Also see the additional comments in response to the answer.) See https://stackoverflow.com/questions/25424382/replace-single-backslash-in-r.

References

  1. LibreCAD, User Manual - Fundamentals: Units: Engineering and Decimal, 7 May 2022, https://librecad-docs-dev.readthedocs.io/en/latest/ref/fundamentals.html#units.

  2. LibreCAD rs_units.cpp code referencing how to calculate the engineering units.

Examples


# Please refer to the iemisc: Construction Measurement Examples vignette for
# additional examples

library(iemisc)

librecad1a <- "1 ft 2 7/16\""

construction_decimal_eng(librecad1a)


librecad4a <- 14.43112

construction_decimal_eng(librecad4a)


librecad5a <- 14.4375

construction_decimal_eng(librecad5a)


librecad6a <- 17.71354

construction_decimal_eng(librecad6a)


librecad7a <- 86.000000

construction_decimal_eng(librecad7a)


checkst <- 14.43112

construction_decimal_eng(checkst)

construction_fraction(checkst, type = "librecad", result = "traditional",
fraction = 16)









iemisc documentation built on Sept. 25, 2023, 5:09 p.m.