Simple Log regression model in R I am trying to fit a regression model, as the plot says the relation is log.

I tried to use 
lm(logData$x ~ logData$b3, data = logData) 

but it did not work because it fits the linear model.
Also I tried to use 
model = nls(logData$x ~ logData$b3) 

but it gives me errors.
So, what I need to do is fit the simple log regression also plot the regression curve on the scatter plot. 
 A: In my opinion, it's a good strategy to transform your data before performing linear regression model as your data show good log relation:
> #generating the data
> n=500
> x <- 1:n
> set.seed(10)
> y <- 1*log(x)-6+rnorm(n)
> 
> #plot the data
> plot(y~x)
> 
> #fit log model
> fit <- lm(y~log(x))
> #Results of the model
> summary(fit)

Call:
lm(formula = y ~ log(x))

Residuals:
     Min       1Q   Median       3Q      Max 
-3.06157 -0.69437 -0.00174  0.76330  2.63033 

Coefficients:
            Estimate Std. Error t value Pr(>|t|)    
(Intercept)  -6.4699     0.2471  -26.19   <2e-16 ***
log(x)        1.0879     0.0465   23.39   <2e-16 ***
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 1.014 on 498 degrees of freedom
Multiple R-squared:  0.5236,    Adjusted R-squared:  0.5226 
F-statistic: 547.3 on 1 and 498 DF,  p-value: < 2.2e-16

>
> coef(fit)
(Intercept)      log(x) 
  -6.469869    1.087886 
> 
> #plot 
> x=seq(from=1,to=n,length.out=1000)
> y=predict(fit,newdata=list(x=seq(from=1,to=n,length.out=1000)),
+           interval="confidence")
> matlines(x,y,lwd=2)

Results of the previous code:

