Skip to content

Commit

Permalink
Merge pull request #71 from adamlilith/solstice2022_2023
Browse files Browse the repository at this point in the history
Solstice2022 2023
  • Loading branch information
adamlilith committed Apr 3, 2024
2 parents d61fb86 + dcc93b5 commit ec557d9
Show file tree
Hide file tree
Showing 6 changed files with 66 additions and 57 deletions.
3 changes: 2 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
omnibus 1.2.11 (2024-03-26)
omnibus 1.2.11 (2024-04-03)
===========
o Added functions `compareFloat()` and aliases
o Added function `is.wholeNUmber()`
o Added function `forwardSlash()`
o Fixed bug in `convertUnits()` for converting between meters and kilometers

omnibus 1.2.10 (2024-03-10)
===========
Expand Down
30 changes: 16 additions & 14 deletions R/convertUnits.r
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,22 @@
#' @description This function converts length and area values from one unit to another (e.g., meters to miles, or square yards to acres). Alternatively, it provides the conversion factor for changing one unit to another.
#'
#' @param from,to Character: Names of the units to convert from/to. Partial matching is used, and case is ignored. Valid values are listed below. The \code{'*2'} values represent areas (e.g., \code{'m2'} is "meters-squared").
#' * \code{'m'} or \code{'meters'}
#' * \code{'m2'} or \code{'meters2'}
#' * \code{'km'} or \code{'kilometers'}
#' * \code{'km2'} or \code{'kilometers2'}
#' * \code{'mi'} or \code{'miles'}
#' * \code{'mi2'} or \code{'miles2'}
#' * \code{'ft'} or \code{'feet'}
#' * \code{'ft2'} or \code{'feet2'}
#' * \code{'yd'} or \code{'yards'}
#' * \code{'yd2'} or \code{'yards2'}
#' * \code{'ac'} or \code{'acres'}
#' * \code{'ha'} or \code{'hectares'}
#' * \code{'nmi'} or \code{'nautical miles'}
#' * \code{'nmi2'} or \code{'nautical miles2'}
#' \itemize{
#' \item \code{'m'} or \code{'meters'}
#' \item \code{'m2'} or \code{'meters2'}
#' \item \code{'km'} or \code{'kilometers'}
#' \item \code{'km2'} or \code{'kilometers2'}
#' \item \code{'mi'} or \code{'miles'}
#' \item \code{'mi2'} or \code{'miles2'}
#' \item \code{'ft'} or \code{'feet'}
#' \item \code{'ft2'} or \code{'feet2'}
#' \item \code{'yd'} or \code{'yards'}
#' \item \code{'yd2'} or \code{'yards2'}
#' \item \code{'ac'} or \code{'acres'}
#' \item \code{'ha'} or \code{'hectares'}
#' \item \code{'nmi'} or \code{'nautical miles'}
#' \item \code{'nmi2'} or \code{'nautical miles2'}
#' }
#'
#' @param x Numeric or \code{NULL} (default). The value(s) to convert in the unit specified by \code{from}. If left as \code{NULL}, the conversion factor is reported instead.
#'
Expand Down
30 changes: 16 additions & 14 deletions R/expandUnits.r
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,22 @@
#' @description This function converts abbreviations of length and area units (e.g., "m", "km", and "ha") to their proper names (e.g., "meters", "kilometers", "hectares"). Square areal units are specified using an appended "2", where appropriate (e.g., "m2" means "meters-squared" and will be converted to "meters2").
#'
#' @param x Character: Abbreviations to convert. Case is ignored.
#' * \code{'m'} will be converted to \code{'meters'}
#' * \code{'m2'} will be converted to \code{'meters2'}
#' * \code{'km'} will be converted to \code{'kilometers'}
#' * \code{'km2'} will be converted to \code{'kilometers2'}
#' * \code{'mi'} will be converted to \code{'miles'}
#' * \code{'mi2'} will be converted to \code{'miles2'}
#' * \code{'ft'} will be converted to \code{'feet'}
#' * \code{'ft2'} will be converted to \code{'feet2'}
#' * \code{'yd'} will be converted to \code{'yards'}
#' * \code{'yd2'} will be converted to \code{'yards2'}
#' * \code{'ac'} will be converted to \code{'acres'}
#' * \code{'ha'} will be converted to \code{'hectares'}
#' * \code{'nmi'} will be converted to \code{'nautical miles'}
#' * \code{'nmi2'} will be converted to \code{'nautical miles2'}
#' \itemize{
#' \item \code{'m'} will be converted to \code{'meters'}
#' \item \code{'m2'} will be converted to \code{'meters2'}
#' \item \code{'km'} will be converted to \code{'kilometers'}
#' \item \code{'km2'} will be converted to \code{'kilometers2'}
#' \item \code{'mi'} will be converted to \code{'miles'}
#' \item \code{'mi2'} will be converted to \code{'miles2'}
#' \item \code{'ft'} will be converted to \code{'feet'}
#' \item \code{'ft2'} will be converted to \code{'feet2'}
#' \item \code{'yd'} will be converted to \code{'yards'}
#' \item \code{'yd2'} will be converted to \code{'yards2'}
#' \item \code{'ac'} will be converted to \code{'acres'}
#' \item \code{'ha'} will be converted to \code{'hectares'}
#' \item \code{'nmi'} will be converted to \code{'nautical miles'}
#' \item \code{'nmi2'} will be converted to \code{'nautical miles2'}
#' }
#'
#' @seealso \code{\link{convertUnits}}, \code{\link{conversionFactors}}
#'
Expand Down
Binary file modified data/conversionFactors.rda
Binary file not shown.
30 changes: 16 additions & 14 deletions man/convertUnits.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 16 additions & 14 deletions man/expandUnits.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit ec557d9

Please sign in to comment.