I am using fit_easylinear for my 96 well plates data. From growthrate I am using fit_easylinear for which the data should not duplicated. In my data, time is duplicated for each well (A!,A2,A3 etc). With the help of one of the stackoverflow user, I am able to run fit_easylinear in a loop but I am struggling to make the plots for fit result. The code that I have so far:
library(growthrates)
library(tidyverse)
set.seed(11)
df <- data.frame(time = seq(0, 865),
A1 = runif(866, 0, 1),
A2 = runif(866, 0, 1),
A3 = runif(866, 0, 1),
A4 = runif(866, 0, 1),
A5 = runif(866, 0, 1),
A6 = runif(866, 0, 1),
A7 = runif(866, 0, 1),
A8 = runif(866, 0, 1),
A9 = runif(866, 0, 1),
A10 = runif(866, 0, 1),
A11 = runif(866, 0, 1),
A12 = runif(866, 0, 1),
B1 = runif(866, 0, 1),
B2 = runif(866, 0, 1),
B3 = runif(866, 0, 1),
B4 = runif(866, 0, 1),
B5 = runif(866, 0, 1),
B6 = runif(866, 0, 1),
B7 = runif(866, 0, 1),
B8 = runif(866, 0, 1),
B9 = runif(866, 0, 1),
B10 = runif(866, 0, 1),
B11 = runif(866, 0, 1),
B12 = runif(866, 0, 1),
C1 = runif(866, 0, 1),
C2 = runif(866, 0, 1),
C3 = runif(866, 0, 1),
C4 = runif(866, 0, 1),
C5 = runif(866, 0, 1),
C6 = runif(866, 0, 1),
C7 = runif(866, 0, 1),
C8 = runif(866, 0, 1),
C9 = runif(866, 0, 1),
C10 = runif(866, 0, 1),
C11 = runif(866, 0, 1),
C12 = runif(866, 0, 1))
###################### fit easy linear model
fit_list <- lapply(2:length(colnames(df)), function(x) fit_easylinear(df$time, df[[x]]))
######This plots all the values but dose not show the actual fit for (i in seq_along(fit_list)) {jpeg(paste0("C:/Users/Desktop/images/", colnames(df)[i+1], ".jpg")); plot(slot(fit_list[[i]], "obs")); dev.off() }
###### removed slot from the code
for (i in seq_along(fit_list)) {jpeg(paste0("C:/Users/Rahul/Desktop/images", colnames(df)[i+1], ".jpg"));plot(fit_list[[i]]) ;dev.off()}
From th above line of code gives me error as Error in seq.default(min(obs[, "time"] + lag), max(obs[, "time"]), length = 200) :
'from' must be a finite number
