growthcurver
growthcurver copied to clipboard
Cannot use t_trim with blank
Hi Kathleen,
I've been trying to use your package to fit growthcurves. I have noticed a slight issue when trying to trim the growth data up to a specific timepoint while using a vector of blanks measurements (using both t_trim and blank options)
I get the following warning message:
Warning message:
In data_n - blank :
longer object length is not a multiple of shorter object length
This message disappears with any other option than bg_correct='blank'
This is quite weird to me, given that all my input have the same exact length.
Here are the lines, I believe, should be corrected. https://github.com/sprouffske/growthcurver/blob/25ea4b301311e95cbc8d18f5c30fb4c750782869/R/summarize-growth.R#L118-L124
I suggest to modify the order of the trimming steps so trimming the timepoints is done at the end.
if (t_trim > 0) {
t_max <- t_trim
data_n <- data_n[data_t < t_trim]
if (bg_correct == "blank") {
blank <- blank[data_t < t_trim] # Should be done before trimming **data_t**
}
data_t <- data_t[data_t < t_trim] # Should be done last
}
Anyhow thank you for this package which was pretty useful to my research.
Best Benjamin
Thanks for reporting this, and I'll fix this in the next version.