tombishop1 / itraxBook

Book on the use of R for Itrax data processing
https://tombishop1.github.io/itraxBook/
Creative Commons Attribution 4.0 International
1 stars 0 forks source link

Ratios need oob handling #3

Closed tombishop1 closed 3 years ago

tombishop1 commented 3 years ago

Sometimes ratios create Inf values. These need dealing with before plotting, either using na_if(Inf) or some clever use of scale_x_continuous(oob = scales::oob_censor_any()).

tombishop1 commented 3 years ago

OK, a trivial reproducible example is CD166_19_xrf$Fe/CD166_19_xrf$Sc.

A suggested fix:

CD166_19_xrf %>%
  mutate(`Fe/Sc` = Fe/Sc) %>%
  mutate_if(is.numeric, list(~na_if(., Inf))) %>%
  pull(`Fe/Sc`)
tombishop1 commented 3 years ago

Closed with de8090c