Skip to content

Commit

Permalink
Correct order of X and Y in chart.nls()
Browse files Browse the repository at this point in the history
  • Loading branch information
phgrosjean committed Apr 23, 2024
1 parent 03c7887 commit a01f0db
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions R/chart.nls.R
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ type = c("model", "resfitted", "qqplot", "scalelocation", "reshist",
(function(nls) {
adata <- augment(nls)
ndata <- names(adata)
X <- as.name(ndata[1])
Y <- as.name(ndata[2])
X <- as.name(ndata[2])
Y <- as.name(ndata[1])
chart(data = adata, aes(x = {{ X }}, y = {{ Y }})) + # Was: aes_string(x = X, y = Y)) +
geom_point() +
stat_function(fun = as.function(nls), col = "skyblue3", size = 1)
Expand Down

0 comments on commit a01f0db

Please sign in to comment.