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

Missing log1p_implementation #41

Closed
andremrsantos opened this issue Feb 26, 2014 · 1 comment
Closed

Missing log1p_implementation #41

andremrsantos opened this issue Feb 26, 2014 · 1 comment

Comments

@andremrsantos
Copy link

Working over my data analysis, I face the need to present a value ranging from 0 to 700 using a log10 transformation. To avoid corrections like add +1 to the var, I decided to check the available transformations and found just what I was looking for in the log1p_trans().
Unfortunately, the function was not yet implement or at least I could not use it. To attend this issue may I propose a small correction using the following code:

log1p_trans <- function(base) {
  trans_new("log1p", function(x) log(x+1,base), function(x) base^x - 1)
}

This piece of code make everything work just fine here and I belive it should help others facing the same issue 👍

hadley added a commit that referenced this issue Jun 10, 2015
@hadley
Copy link
Member

hadley commented Jun 10, 2015

It works for me as is. Do you have a minimal reprex?

@hadley hadley closed this as completed Jun 10, 2015
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