-
-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Standardize: unnecessary argument #30
Comments
d <- iris[1:5, 1:4]
datawizard::standardise(d)
#> Sepal.Length Sepal.Width Petal.Length Petal.Width
#> 1 1.1573828 0.8499342 0.000000 0.2
#> 2 0.1928971 -1.0817344 0.000000 0.2
#> 3 -0.7715885 -0.3090670 -1.414214 0.2
#> 4 -1.2538313 -0.6954007 1.414214 0.2
#> 5 0.6751400 1.2362679 0.000000 0.2
datawizard::standardise(d, append = TRUE)
#> Sepal.Length Sepal.Width Petal.Length Petal.Width Sepal.Length_z
#> 1 5.1 3.5 1.4 0.2 1.1573828
#> 2 4.9 3.0 1.4 0.2 0.1928971
#> 3 4.7 3.2 1.3 0.2 -0.7715885
#> 4 4.6 3.1 1.5 0.2 -1.2538313
#> 5 5.0 3.6 1.4 0.2 0.6751400
#> Sepal.Width_z Petal.Length_z Petal.Width_z
#> 1 0.8499342 0.000000 0.2
#> 2 -1.0817344 0.000000 0.2
#> 3 -0.3090670 -1.414214 0.2
#> 4 -0.6954007 1.414214 0.2
#> 5 1.2362679 0.000000 0.2 Created on 2021-11-04 by the reprex package (v2.0.1) |
It's rather that d <- iris[1:5, 1:4]
datawizard::standardise(d, suffix = "_z")
#> Sepal.Length Sepal.Width Petal.Length Petal.Width
#> 1 1.1573828 0.8499342 0.000000 0.2
#> 2 0.1928971 -1.0817344 0.000000 0.2
#> 3 -0.7715885 -0.3090670 -1.414214 0.2
#> 4 -1.2538313 -0.6954007 1.414214 0.2
#> 5 0.6751400 1.2362679 0.000000 0.2 Created on 2021-11-04 by the reprex package (v2.0.1) |
This was referenced Nov 4, 2021
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Just noticed this:
datawizard/R/standardize.R
Lines 186 to 187 in 5ab5cdc
It seems like we could have just had
suffix=NULL
by default and ifsuffix="z_"
then it's added, no need for a toggle argumentappend
on top of that as it makes it more confusing and weighs the API downI can make a quick fix providing it won't break a thousand things ^^
The text was updated successfully, but these errors were encountered: