Skip to content

Commit

Permalink
[fix] Remove deprecated units functions from NAMESPACE
Browse files Browse the repository at this point in the history
  • Loading branch information
Hongyuan Jia committed Feb 22, 2021
1 parent 3239540 commit 20a25a6
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 19 deletions.
2 changes: 0 additions & 2 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -325,8 +325,6 @@ importFrom(stringi,stri_wrap)
importFrom(tools,file_ext)
importFrom(tools,file_path_sans_ext)
importFrom(units,drop_units)
importFrom(units,install_conversion_constant)
importFrom(units,install_symbolic_unit)
importFrom(units,set_units)
importFrom(utils,capture.output)
importFrom(utils,combn)
Expand Down
23 changes: 11 additions & 12 deletions R/units.R
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
#' @importFrom data.table fread
#' @importFrom units install_symbolic_unit install_conversion_constant
NULL

# reg_custom_units {{{
reg_custom_units <- function () {
tryCatch(
{
if (packageVersion("units") < 0.7) {
install_symbolic_unit("person")
install_symbolic_unit("dollar")
install_symbolic_unit("thousandths")
install_conversion_constant("Wh", "J", 3.6E3)
install_conversion_constant("inH2O", "inch_H2O_39F", 1)
if (utils::packageVersion("units") < 0.7) {
units::install_symbolic_unit("person")
units::install_symbolic_unit("dollar")
units::install_symbolic_unit("thousandths")
units::install_conversion_constant("Wh", "J", 3.6E3)
units::install_conversion_constant("inH2O", "inch_H2O_39F", 1)
} else {
install_unit("person")
install_unit("dollar")
install_unit("thousandths")
install_unit("Wh", "3.6E3 J")
install_unit("inH2O", "1 inch_H2O_39F")
units::install_unit("person")
units::install_unit("dollar")
units::install_unit("thousandths")
units::install_unit("Wh", "3.6E3 J")
units::install_unit("inH2O", "1 inch_H2O_39F")
}
TRUE
},
Expand Down
2 changes: 1 addition & 1 deletion man/Epw.Rd

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

2 changes: 1 addition & 1 deletion man/Idf.Rd

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

4 changes: 2 additions & 2 deletions man/IdfObject.Rd

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

2 changes: 1 addition & 1 deletion man/get_idf_table.Rd

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

0 comments on commit 20a25a6

Please sign in to comment.