I am trying to plot an adjustable logarithmic curve with ggplot2. From various Stack Overflow posts I was able to create this:
key <- c(1,2,300)
value <- c(10, 20, 300)
dummyData <- data.frame(key, value)
# ggplot graph plotting
graph <- ggplot(dummyData, mapping = aes(x=key, y=value))+
stat_smooth(
method = 'nls',
formula = 'y ~ a * log(x) + b',
method.args = list(
start = list(a = 1, b = 1)
),
se = FALSE
)
print(graph)
However, no matter what extreme value I put the start = list(a = 1, b = 1) line, I couldn't adjust the logarithmic curve at all.


