[R] Reading data

Vassilis Golfinopoulos vassilis.golfinopoulos at gmail.com
Wed Oct 28 15:26:00 CET 2009

Hi Val,

Windows does not display extensions by default. Check the 'Type'
column; it should read 'R file'.

Keep in mind what you are dealing with; Rossi.R is a script, so you
cannot open it with read.table. You have to use source() for that.
Moreover, use the extension, as well (Rossi.R, not Rossi)


On Wed, Oct 28, 2009 at 3:04 PM, Val <valkremk at gmail.com> wrote:
> Hi User's,
> This might be a simple question but it is giving me a hard time as I am a
> new user.
> I installed  R version 2.9.2 (2009-08-24)
> 1. I just copied a short script from Fox (2002) as a practice   and wanted
> to save it as Rossi.R.
> The system saved it without complain but when I looked at  using a windows
> explorer  it is not *.R file but only Rossi. Why this is happening?
> 2. the script and the data files are in the same working directory. When I
> run the following script
>    >  Rossi <- read.table('Rossi',header=T)
>   >   Rossi[1:5,1:10]
> I got the following error messages
>            Error in file(file, "r") : cannot open the connection
>            In addition: Warning message:
>            In file(file, "r") : cannot open file 'Rossi': No such file or
> directory
>          > Rossi[1:5,1:10]
>           Error: object 'Rossi' not found
> Thank you for your help in advance
> Val
>        [[alternative HTML version deleted]]
> ______________________________________________
> 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.

More information about the R-help mailing list