-
-
Notifications
You must be signed in to change notification settings - Fork 16
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
Remove the data_*()
prefix from statistical transformation function names
#197
Comments
Specifically, here is what the function names look like right now: Preparation
Transformation:
And I am wondering if the following should lose their
|
The problem is cut() is in base and recode() is in dplyr. shift() is in data.table--that's probably less of a collision issue, but I imagine we probably have a fair number of data.table users |
There are also:
All of these functions have methods for both vectors and data frames. Is it more confusing to be able to use a function without |
How about:
I don't know which is better, removing
|
cut > discretize? I think it's a good idea to have dedicated |
I would prefer not to have prefixes for vector functions |
Same, that's what I mean - the #' @export
standardize <- function(x, ...) {
UseMethod("standardize")
}
#' @export
#' @rdname standardize
standardize.numeric <- function(...) {
...
}
#' @export
#' @rdname standardize
standardize.data.frame <- function(...) {
...
}
#' @export
#' @rdname standardize
data_standardize <- standardize.data.frame Or perhaps all the |
reverse_scale() is not exactly an alias. It has fewer arguments and is designed to provide a more intuitive function for using rescale() to reverse |
I think I like the idea of documenting the data frame methods all together. |
My votes:
(For 2,
|
I second all of what @bwiernik says, except for |
Whatever we decide for Wmwe should avoid having conflicts with base R at all cost Why not having another alias for all these transfo functions like: values_recode(), values_reverse() etc so that data_ is meant primarily for dfs and values_ for vectors. It's a bit longer to type but autocompletion much |
|
of the available synonyms for "recode", "relabel" seemed the least objectionable. A conflict with dplyr is nearly as bad as a conflict with base IMO. I don't think that "relabel" precludes numeric values--the function changes the numeric labels used for different categories. And in contrast to rescale(), it does it through 1:1 mapping of values/labels, rather than a linear or other mathematical transformation |
agree-
I prefer recode here (or put differently: I don't like "relabel"), because relabel sounds like changing value labels (I always have the association with labelled data)
agree.
agree.
agree.
agree. |
We can't do |
|
That word means "reassess the worth of something" |
convert? |
I think that suggests type conversion (numeric -> factor or character, etc.) |
Perhaps |
The problem with
But I also agree that So I guess |
@bwiernik Which function is this? Definitely not in datawizard. |
data_to_factor, data_to_numeric, etc. that family of functions |
Ah, I see! Got it. In that case, the following comment is irrelevant:
|
If we're renaming How about datawizard/R/data_to_numeric.R Lines 262 to 268 in 3a3529b
|
We could integrate it, having an argument that either preserves factors or coerces to numeric. Have you checked other packages for usage of |
Yeah, that sounds better.
Few do, but I'd worry only about tidyverse namespace collisions. |
Sorry, I was referring to internal uses of |
AFAICT, it is used only in one place: https://github.com/easystats/modelbased/blob/671ba596eeb350536d08290ee97248145d7fdba0/R/visualisation_recipe.estimate_grouplevel.R#L41 So we can definitely make this breaking change. |
Since it will be removed from datawizard: easystats/datawizard#197 (comment) modelbased needs to be updated on CRAN before datawizard.
* Use internal copy of to_numeric Since it will be removed from datawizard: easystats/datawizard#197 (comment) modelbased needs to be updated on CRAN before datawizard. * Update render-readme.yml * Update render-readme.yml
Moved here, since it is not related to the vignette about equivalence with tidyverse
The text was updated successfully, but these errors were encountered: