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

Replace floor_mult with existing function? #271

Closed
athowes opened this issue Aug 30, 2024 · 4 comments
Closed

Replace floor_mult with existing function? #271

athowes opened this issue Aug 30, 2024 · 4 comments

Comments

@athowes
Copy link
Collaborator

athowes commented Aug 30, 2024

The floor_mult function is this:

floor_mult <- function(x, f = 1) {
  checkmate::assert_numeric(f, lower = 0)
  ifelse(f == 0, x, floor(x / f) * f)
}

It does the floor of a multiple (aside from 1). I'd expect this must have been implemented somewhere else that we could rely upon. Seems quite closely related to e.g. %% and %/%.

@athowes athowes added the low label Aug 30, 2024
@athowes
Copy link
Collaborator Author

athowes commented Sep 12, 2024

Looks like there is something like it in plyr: https://stackoverflow.com/questions/43627679/round-any-equivalent-for-dplyr

@seabbs
Copy link
Contributor

seabbs commented Sep 12, 2024

Can we get around this by depending on primarycensoreddist instead for simulation?

@athowes
Copy link
Collaborator Author

athowes commented Oct 4, 2024

We can on the simulation but I think we will still need it again in the adding censored columns.

@seabbs seabbs removed the low label Feb 26, 2025
@seabbs
Copy link
Contributor

seabbs commented Mar 5, 2025

This seems hard to avoid with a new function being exposed in primarycensored which I don't think we want to do so voting to leave and closing. Reopen if you feel strongly we should look for ways to remove.

@seabbs seabbs closed this as completed Mar 5, 2025
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

No branches or pull requests

2 participants