I have a dataset www.dropbox.com/s/qemmepoq105rth2/sample_data_trasport.csv?dl=0
using code
shapes <- c(5, 16, 18, 3, 15, 4, 6, 8, 17, 13, 2)
trasport_time %>%
filter(PM2.5 > 25) %>%
ggplot(aes(x = Transport_time_hrs, y = mac_405, shape=(Fire_Name),
color=(day))) +
geom_point( alpha=1, size = 4)+ scale_shape_manual(values = shapes)+
xlim(0,25)+
ylim(0,1.5) + #geom_smooth(aes(group = 1),method=nls, se=F)+
geom_smooth(aes(group = 1), method = "nls", formula = y ~ a * x^b,
se = FALSE, method.args = list(start = c(a = 1, b = 1))) +
theme(legend.text=element_text(size=12)) +
theme(axis.title = element_text(face="plain",size=14,color="black"),
axis.text=element_text(size=12,face="plain", color="black"),
plot.title = element_text(size=15)) +
ylab(bquote("MAC"[(405*nm)]~ '('*m^2*g^-1*')')) +
xlab(bquote('Transport Time ('*hrs*')')) +
labs(title = "")+ labs(shape="Fire", color="Day")
From this code, I am, able to draw the fitting line, but I am not able to add the fitting equation for example: y(t)= y(e)−kt (k = half-life
Read more here: Source link