[R] Importing a CSV file

2012-09-19 Thread Anthi Oikonomou
Hi, I am trying to import csv file in R console I have saved my data in a file on the desktop named R and here is my problematic script load(C:\\Users\\Anthi\\Desktop\\R\\A.csv) Error: bad restore file magic number (file may be corrupted) -- no data loaded In addition: Warning message: file

Re: [R] Importing a CSV file

2012-09-19 Thread Sarah Goslee
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.oi...@gmail.com wrote: Hi, I am trying to import

Re: [R] Importing a CSV file

2012-09-19 Thread Rui Barradas
Hello, Try ?read.csv. dat - read.csv(C:\\Users\\Anthi\\Desktop\\R\\A.csv) Note that unlike what happens with load() you'll need an explicit assignment. Hope this helps, Rui Barradas Em 19-09-2012 09:54, Anthi Oikonomou escreveu: Hi, I am trying to import csv file in R console I have

Re: [R] Importing a CSV file

2012-09-19 Thread Frans Marcelissen
: woensdag 19 september 2012 15:44 Aan: Anthi Oikonomou CC: r-h...@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

Re: [R] Importing a CSV file

2012-09-19 Thread Sarah Goslee
Aan: Anthi Oikonomou CC: r-h...@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

Re: [R] Importing a CSV file

2012-09-19 Thread Rui Barradas
:\ (There is no such thing as c: --- c:\\). Rui Barradas Sarah -Oorspronkelijk bericht- Van: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] Namens Sarah Goslee Verzonden: woensdag 19 september 2012 15:44 Aan: Anthi Oikonomou CC: r-h...@stat.math.ethz.ch Onderwerp: Re: [R] Importing

Re: [R] Importing a CSV file

2012-09-19 Thread Marc Schwartz
Verzonden: woensdag 19 september 2012 15:44 Aan: Anthi Oikonomou CC: r-h...@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

Re: [R] Importing a CSV file

2012-09-19 Thread Heramb Gadgil
...@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

Re: [R] Importing a CSV file

2012-02-10 Thread peter dalgaard
On Feb 10, 2012, at 04:20 , sezgin ozcan wrote: I use mac. I tried this command also a-read.table(clipboard,sep=”\t”,row.names=1,header=T) Something is wrong with those quotes around \t... Also, last I needed this, using file=clipboard to read from the clipboard didn't work on Mac, but

Re: [R] Importing a CSV file

2012-02-10 Thread David L Carlson
-project.org] On Behalf Of sezgin ozcan Sent: Thursday, February 09, 2012 9:21 PM To: r-h...@stat.math.ethz.ch Subject: [R] Importing a CSV file I have been trying to import a csv file to r. but I get the same message everytime. the message is Error in file(file, rt) : cannot open the connection

Re: [R] Importing a CSV file

2012-02-10 Thread MacQueen, Don
I think you must have given the path to the file wrong. Assuming you are using R.app, try infile - file.choose() And then give infile to the read.csv() function. Then print the value of infile to find out what the path really is. Probably, you wanted

[R] Importing a CSV file

2012-02-09 Thread sezgin ozcan
I have been trying to import a csv file to r. but I get the same message everytime. the message is Error in file(file, rt) : cannot open the connection In addition: Warning message: In file(file, rt) : cannot open file 'Users:/sezginozcan/Downloads/beer.data.csv': No such file or directory I

Re: [R] Importing a CSV file

2012-02-09 Thread R. Michael Weylandt
There's not usually a colon in Mac file paths. I would have expected /Users/sezginozcan/Downloads.beer.data.csv instead. Did you check that? More generally, type dir(PATHWHEREYOUTHINKFILEIS) and see if it really is there. Michael On Thu, Feb 9, 2012 at 10:20 PM, sezgin ozcan szgoz...@gmail.com

Re: [R] Importing a CSV file

2012-02-09 Thread Jorge I Velez
Hi Sezgin, An alternative option If you do not know the path to your file, is to use file.choose() within read.table() to locate it in your machine: a - read.table(file.choose(), sep = \t, rownames = 1, header = TRUE) # a window will pop up! head(a) However, in my experience, it is always