Skip to content

Importing a CSV file

8 messages · Anthi Oikonomou, Rui Barradas, Frans Marcelissen +3 more

#
Hi,

load() is for R's binary data files. You need to use read.csv(), as
you tried, but probably with the complete path.

A <- read.csv("C:\\Users\\Anthi\\Desktop\\R\\A.csv", header=TRUE)

Sarah
On Wed, Sep 19, 2012 at 4:54 AM, Anthi Oikonomou <anthi.oikon at gmail.com> wrote:

  
    
#
Hi,
Should'nt it be A <- read.csv("C:\\\\Users\\Anthi\\Desktop\\R\\A.csv",
header=TRUE)
(c:\\ becomes c:\ In general I think it is better to use / and //)
Frans

-----Oorspronkelijk bericht-----
Van: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org]
Namens Sarah Goslee
Verzonden: woensdag 19 september 2012 15:44
Aan: Anthi Oikonomou
CC: r-help at stat.math.ethz.ch
Onderwerp: Re: [R] Importing a CSV file

Hi,

load() is for R's binary data files. You need to use read.csv(), as you
tried, but probably with the complete path.

A <- read.csv("C:\\Users\\Anthi\\Desktop\\R\\A.csv", header=TRUE)

Sarah

On Wed, Sep 19, 2012 at 4:54 AM, Anthi Oikonomou <anthi.oikon at gmail.com>
wrote:
--
Sarah Goslee
http://www.functionaldiversity.org

______________________________________________
R-help at r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
#
On Wed, Sep 19, 2012 at 9:53 AM, Frans Marcelissen
<frans.marcelissen at digipsy.nl> wrote:
No idea; I was copying the original poster's version. In this case, it
would definitely be better to take advice on path construction from
someone who uses Windows!

Sarah

  
    
#
Em 19-09-2012 15:01, Sarah Goslee escreveu:
I use Windows and the answer is no, the four backslashes don't make 
sense, because like Frans said, c:\\ becomes c:\
(There is no such thing as c:\\\\ ---> c:\\).

Rui Barradas
#
On Sep 19, 2012, at 9:26 AM, Rui Barradas <ruipbarradas at sapo.pt> wrote:

            
Ahoy Mateys,

Not to mention, creating file paths on Windows is an Arrrr FAQ:

  http://cran.r-project.org/bin/windows/base/rw-FAQ.html#R-can_0027t-find-my-file

Savvy?

Marc Schwartz

P.S. It's International Talk Like a Pirate Day, which of course fits with a certain language we all hold dear. Somebody had to do it... ;-)