Closed rpruim closed 6 years ago
Note: This does work. This goes back to our use of model.frame()
df_stats( ~I(length / width), data = KidsFeet)
## min Q1 median Q3 max mean sd n missing
## 1 2.525773 2.635853 2.755102 2.858485 3 2.752867 0.1293831 39 0
This also works because left and right sides of formula are treated differently.
df_stats( length / width ~ 1, data = KidsFeet)
## min Q1 median Q3 max mean sd n missing
## 1 2.525773 2.635853 2.755102 2.858485 3 2.752867 0.1293831 39 0
By pre-processing the formula, we can get some arithmetic operations (/
, *
, ^
) that are handled specially by model.frame()
to be treated like regular arithmetic. Parens force evaluation as well.
df_stats( ~ (length / width), data = KidsFeet)
## min Q1 median Q3 max mean sd n missing
## 1 2.525773 2.635853 2.755102 2.858485 3 2.752867 0.1293831 39 0
df_stats( ~ length / width, data = KidsFeet)
## min Q1 median Q3 max mean sd n missing
## 1 2.525773 2.635853 2.755102 2.858485 3 2.752867 0.1293831 39 0
df_stats( ~ (length + width), data = KidsFeet)
## min Q1 median Q3 max mean sd n missing
## 1 29.5 32.75 33.4 35 37.3 33.71538 1.690148 39 0
Closing this here. Will be fixed in mosaicCore
.