Displaying 3 results from an estimated 3 matches for "set_unit".
Did you mean:
set_units
2019 Feb 18
3
Encoding issues
Hi,
We found a (to our eyes) strange behaviour that might be a bug. First
a little bit of context. The 'units' package allows us to set the unit
using both SE or NSE. E.g., these both work in the same way:
units::set_units(1:10, "?m")
#> Units: [?m]
#> [1] 1 2 3 4 5 6 7 8 9 10
units::set_units(1:10, ?m)
#> Units: [?m]
#> [1] 1 2 3 4 5 6 7 8 9 10
That's micrometers, and works fine if the session charset is UTF-8.
Now the funny part comes with Windows. The first version, w...
2019 Feb 18
0
Encoding issues
...;iucar at fedoraproject.org> wrote:
>
> Hi,
>
> We found a (to our eyes) strange behaviour that might be a bug. First
> a little bit of context. The 'units' package allows us to set the unit
> using both SE or NSE. E.g., these both work in the same way:
>
> units::set_units(1:10, "?m")
> #> Units: [?m]
> #> [1] 1 2 3 4 5 6 7 8 9 10
>
> units::set_units(1:10, ?m)
> #> Units: [?m]
> #> [1] 1 2 3 4 5 6 7 8 9 10
>
> That's micrometers, and works fine if the session charset is UTF-8.
> Now the funny pa...
2019 Jan 21
1
Request: make `var` a generic
...its`:
units:::mean.units
function (x, ...)
{
.as.units(NextMethod(), units(x))
}
This is, however, not possible for `var` (as it's not a generic), which
breaks `summary.lm`:
```
library(units)
#> udunits system database from C:/R/Library/3.5/units/share/udunits
iris$Sepal.Length <- set_units(iris$Sepal.Length, "cm")
summary(lm(Sepal.Length ~ Sepal.Width,
data = iris))
#> Error in Ops.units(mean(f)^2, var(f)): both operands of the expression
should be "units" objects
```
Created on 2019-01-21 by the [reprex package](https://reprex.tidyverse.org)
(v0....