mikeblazanin / gcplyr

gcplyr is an R package that facilitates wrangling and analysis of microbial growth curve data
https://mikeblazanin.github.io/gcplyr/
Other
28 stars 2 forks source link

Double warning when log(y) in calc_deriv leads to infinite values #204

Closed mikeblazanin closed 4 months ago

mikeblazanin commented 4 months ago

Can be recreated by passing y values that are below 0 (or maybe just 0 is sufficient) with percapita = TRUE and trans_y = 'log', and get two warnings:

<warning/rlang_warning>
Warning in `mutate()`:
In argument: `derCap = calc_deriv(...)`.
In group 270: `file = DM25DM500_Glu_22Celcius_repeated` and `Well = H7`.
Caused by warning in `calc_deriv()`:
! during log-transformation, simpleWarning in log(sub_y): NaNs produced

[[21]]
<warning/rlang_warning>
Warning in `mutate()`:
In argument: `derCap = calc_deriv(...)`.
In group 270: `file = DM25DM500_Glu_22Celcius_repeated` and `Well = H7`.
Caused by warning in `calc_deriv()`:
! infinite values created during log-transformation, treating as NA's
mikeblazanin commented 4 months ago

This is not actually a bug. We issue two separate warnings intentionally: one indicating that some values became NaN (i.e. were negative), the other indicating that some values became infinite (i.e. were log(0))