Dear list-members,I would like to fit the following model to a ggplot:
I was trying this with stat_function as below, but to no avail. The code represents the solution with the least error informations.mod_1_fit <- stat_function(data = Frequencies,aes(x = A, y = B),#geom = "line",#fun = -log(1-x/sum(A))*mod_1_res[4,3],fun = log(1-A/sum(A))*mod_1_k,colour = "red")I am new to R, to statistics, and to model fitting, and made my way through trial and error. Unfortunately, I don't know how to interprete the error notice."Error in eval(expr, envir, enclos) : object 'A' not found"If this helps, the plot is transformed via coord_trans("log,"log", c(.5, sum(A)), c(.5, sum(A)).Testing the curve alone, it works well in base graphics, so my best guess is that I am misunderstanding some of the intricacies of stat_function().Thanks for your help!K.M.
Dear list-members,I would like to fit the following model to a ggplot:
--
--
You received this message because you are subscribed to the ggplot2 mailing list.
Please provide a reproducible example: https://github.com/hadley/devtools/wiki/Reproducibility
To post: email ggp...@googlegroups.com
To unsubscribe: email ggplot2+u...@googlegroups.com
More options: http://groups.google.com/group/ggplot2
---
You received this message because you are subscribed to the Google Groups "ggplot2" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ggplot2+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
.I was trying this with stat_function as below, but to no avail. The code represents the solution with the least error informations.mod_1_fit <- stat_function(data = Frequencies,aes(x = A, y = B),#geom = "line",#fun = -log(1-x/sum(A))*mod_1_res[4,3],fun = log(1-A/sum(A))*mod_1_k,colour = "red")I am new to R, to statistics, and to model fitting, and made my way through trial and error. Unfortunately, I don't know how to interprete the error notice."Error in eval(expr, envir, enclos) : object 'A' not found"If this helps, the plot is transformed via coord_trans("log,"log", c(.5, sum(A)), c(.5, sum(A)).Testing the curve alone, it works well in base graphics, so my best guess is that I am misunderstanding some of the intricacies of stat_function().Thanks for your help!K.M.