Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
407 B
1
Indexable
Never
#download data
cell_data <- read.csv(file = "IntroSysBio.csv", stringsAsFactors = FALSE)


#Exponential Growth model
#parameters
r1 = 0.1
N0 = cell_data$CellLine1[1]

x = cell_data$Time
y = cell_data$CellLine1

#exponential growth
exp_fit <- nls(y ~ N*exp(r*x), start = list(N = N0, r = r1))
View(exp_fit)

#plot datapoints
plot(x, y, xlab = "Time [h]", ylab = "# Cells")
lines(x, exp_fit)