non-linear least square (nls() function in core R) generates a list object with a bunch of useful info inside, is there also the original data that were the input of the model? I suspect yes, as functions as predict() or fitted() are actually defined on this object and generate predictions in ranges of the original fitted data. So, how can one access this data through the model object?
Imagine this setting
# generating some data
generated_data <- hist(rnorm(1000, 50, 10))
data <- data.frame(x = generated_data$mids, y = generated_data$counts)
# a dummy model
my_model <- nls(y ~ N * dnorm(x, m, s), data=data, start=c(m=55, s=12, N=sum(data$y)) )
How can I access x and y values by the my_model object?