Hi,

On Tue, Jul 10, 2012 at 12:48 PM, F86 <farad...@gmail.com> wrote:
> Hey,
>
> I am having problems with importing a csv file to R.
>
> I could read the file by typing:
> read.csv(file="/Users/kama/Desktop/skatter.csv", header=TRUE, sep=";")

So that command does work?


> However, i can not analyze the "skatter" - for ex, when i type:     skatter
> = read.csv("skatter.csv")

Then you need the above command, not what you type here:

skatter <- read.csv(file="/Users/kama/Desktop/skatter.csv",
header=TRUE, sep=";")

But note that if sep=";" then you don't have a csv file and should
properly use read.table() instead.

> i get this message:
>
> Error in file(file, "rt") : cannot open the connection
> In addition: Warning message:
> In file(file, "rt") :
>
> What i need is to import this file and analyze it using for example
> histogram.
>
> I have Mac(update) and the file is saved in csv file... and I'm quite new
> user of R.

That error means that R can't find the file where you told it to look.
Specifying the full and complete path as in your first example should
work.

If you're having problems with paths (which are a Mac issue and not at
all an R issue), you could also try

read.table(file.choose(), header=TRUE, sep=";")

I think that file.choose() should work on Mac.

The Intro to R document that came with R might also be of use.

Sarah

-- 
Sarah Goslee
http://www.functionaldiversity.org

______________________________________________
R-help@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.

Reply via email to