How do I import a CSV file in R? [closed]

2019-01-23 00:38发布

I have a .csv file in my workstation. How can I open that file in R and do statistical calculation?

标签: r csv import
1条回答
Evening l夕情丶
2楼-- · 2019-01-23 01:08

You would use the read.csv function; for example:

dat = read.csv("spam.csv", header = TRUE)

You can also reference this tutorial for more details.

Note: make sure the .csv file to read is in your working directory (using getwd()) or specify the right path to file. If you want, you can set the current directory using setwd.

查看更多
登录 后发表回答