I have a .csv
file in my workstation. How can I open that file in R and do statistical calculation?
Asked
Active
Viewed 3.2e+01k times
118

Makoto
- 104,088
- 27
- 192
- 230

Uselesssss
- 2,127
- 6
- 28
- 37
-
5have a look at the [R Data Import Export](http://cran.r-project.org/doc/manuals/R-data.pdf) manual – GSee Nov 07 '12 at 19:09
1 Answers
194
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
.

nbro
- 15,395
- 32
- 113
- 196

Paul Hiemstra
- 59,984
- 12
- 142
- 149