I have a very simple question.

After i use the function read.csv to read a csv file using R

i tried to use lm to get the linear regression line for estimation.

But failed because the function didn't get the value in correct form.

Even i used as.numeric for the data and get the slope and intercept, the number seems weird

Here is my code:

data1=read.csv("....csv")

lm(as.numeric(Quantity.Sold)~as.numeric(Average.Price),data=data1)

ggplot(data1,aes(x=Average.Price,y=Quantity.Sold))+geom_point()

The value in x axis is not in ascending due to the "," signal

it is 10.1,10.6,...,12.7,9.7,9.9

I have no idea how to fix this problem, can anyone help me? Thanks in advance