Skip to content

Commit

Permalink
close #232: fix replacement of parts of units
Browse files Browse the repository at this point in the history
  • Loading branch information
Enchufa2 committed Mar 26, 2020
1 parent ad554d5 commit 6ea40d9
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 3 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,6 @@ SystemRequirements: udunits-2
License: GPL-2
URL: https://github.com/r-quantities/units/
BugReports: https://github.com/r-quantities/units/issues/
RoxygenNote: 7.0.2
RoxygenNote: 7.1.0
Roxygen: list(old_usage = TRUE)
Encoding: UTF-8
2 changes: 2 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

S3method("[",mixed_units)
S3method("[",units)
S3method("[<-",units)
S3method("[[",units)
S3method("[[<-",units)
S3method("units<-",logical)
S3method("units<-",mixed_units)
S3method("units<-",numeric)
Expand Down
9 changes: 9 additions & 0 deletions R/misc.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
#' @export
`[<-.units` <- function(x, ..., value) {
units(value) <- units(x)
NextMethod()
}

#' @export
`[[<-.units` <- `[<-.units`

#' @export
c.units <- function(..., recursive = FALSE, allow_mixed = units_options("allow_mixed")) {
args <- list(...)
Expand Down
4 changes: 3 additions & 1 deletion man/ud_units.Rd

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

4 changes: 3 additions & 1 deletion man/unitless.Rd

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

0 comments on commit 6ea40d9

Please sign in to comment.