Skip to content
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

Rename rowmean_n()? #447

Closed
etiennebacher opened this issue Aug 12, 2023 · 9 comments · Fixed by #448
Closed

Rename rowmean_n()? #447

etiennebacher opened this issue Aug 12, 2023 · 9 comments · Fixed by #448
Assignees

Comments

@etiennebacher
Copy link
Member

From @IndrajeetPatil's comment: 6e3182c#commitcomment-124303628

Sorry, I didn't get to weigh in before, but I personally find the function name very dissatisfying, and even a bit misleading. I think the name should make a reference to the fact that this is relevant for missing values. I know that n is mandatory, and so users may figure it out once they use it mistakenly.

How about renaming it to rowmean_n_missing()?

@strengejacke

etiennebacher referenced this issue Aug 12, 2023
* draft mean_n()

* desc, news

* pkgdown

* more performant than apply

* apply more performant

* finalize, add tests

* no rounding by default

* mean_n -> rowmean_n

* address comments

* fix test

* fix

* use rowMeans()

* use .coerce_to_dataframe()

---------

Co-authored-by: Etienne Bacher <52219252+etiennebacher@users.noreply.github.com>
@etiennebacher
Copy link
Member Author

On the other hand, if you see rowmean_n() for the first time, what do you think the n stand for?

rowmean_n_missing() is also a bit misleading IMO because n actually refers to the minimal number of non-missing values required to compute the mean.

@etiennebacher
Copy link
Member Author

I guess if I were a user discovering this function:

  • rowmean_n() -> hard to know that it does because I don't know what the n stands for, so need to check the docs
  • rowmean_n_missing() -> this function computes the rowmean if there are n or more missing values (while it's the opposite)

@IndrajeetPatil
Copy link
Member

When I read that name, my first hunch is that it's going to calculate rowwise mean for the first n rows.

@strengejacke
Copy link
Member

I don't think there is a perfect name for this function, but rowmean_n_missing() looks very cryptic to me.

@strengejacke
Copy link
Member

@DominiqueMakowski
Copy link
Member

DominiqueMakowski commented Aug 13, 2023

Wouldn't it be easier with just a homemade version of row_mean() (or average_cols()) with some select/exclude sugar and anmax_missing argument?

@strengejacke
Copy link
Member

That sounds good!

@strengejacke strengejacke self-assigned this Aug 13, 2023
strengejacke added a commit that referenced this issue Aug 13, 2023
@strengejacke
Copy link
Member

max_missing or min_valid? I'm used to think in minimum amount of valid values...

@etiennebacher
Copy link
Member Author

min_valid sounds better to me

strengejacke added a commit that referenced this issue Sep 7, 2023
* Rename `rowmean_n()`?
Fixes #447

* Update row_means.R

* fix

* fix

* tests

* docs

* update pkgdown

* fix tests

* docs

* Update NEWS.md

Co-authored-by: Etienne Bacher <52219252+etiennebacher@users.noreply.github.com>

* version bump

---------

Co-authored-by: Etienne Bacher <52219252+etiennebacher@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants