Imported a csv-dataset to R but the values becomes factors

后端 未结 8 1453
灰色年华
灰色年华 2020-11-29 01:19

I am very new to R and I am having trouble accessing a dataset I\'ve imported. I\'m using RStudio and used the Import Dataset function when importing my csv-file and pasted

8条回答
  •  天涯浪人
    2020-11-29 01:56

    I'm new to R as well and faced the exact same problem. But then I looked at my data and noticed that it is being caused due to the fact that my csv file was using a comma separator (,) in all numeric columns (Ex: 1,233,444.56 instead of 1233444.56).

    I removed the comma separator in my csv file and then reloaded into R. My data frame now recognises all columns as numbers.

    I'm sure there's a way to handle this within the read.csv function itself.

提交回复
热议问题