Reputation: 199
I have a vector of p-values I want to perform a -log10
transformation on. I'm aware of functions like log2
and log10
but can't seem to find anything on performing a negative log transformation. What I have found is not working. This is my current code:
x <- -log(dataTable$Pvalues, base = 10)
When executed, this gives me a vector with both numeric and infinite (Inf
) values.
How can I correctly perform a transformation with -log10
without getting infinite values?
Upvotes: 0
Views: 2189
Reputation: 72984
Don't know your data, but you could do something like this:
library(dplyr)
dataTable.1 <- dataTable %>%
filter(Pvalues != 0)
x <- -log(dataTable.1$Pvalues, base = 10)
Upvotes: 1