Re: [R] Read.table for macs

About this list Date view Thread view Subject view Author view Attachment view

From: Andrew C. Ward (s195404@student.uq.edu.au)
Date: Wed 22 Jan 2003 - 16:21:42 EST


Message-id: <1043212902.3e2e2a6676c36@my.uq.edu.au>

Hamish,

I usually save Excel files as CSV, and then use read.csv() to get them into R.
Also, there are variants of read.table() that seem more successful at reading
in delimited files (see read.delim, read.delim2).

Regards,

Andrew C. Ward

CAPE Centre
Department of Chemical Engineering
The University of Queensland
Brisbane Qld 4072 Australia
andreww@cheque.uq.edu.au

Quoting Hamish McCallum <hmccallum@zen.uq.edu.au>:

> Dear All,
>
> I've been using R for windows for a while, without too many problems.
> However, I'm forced to use the MAC OS system for teaching, because our
> teaching labs are mac only (not my idea!!). I have a very basic problem,
> but one that doesn't appear on the FAQs. I simply want to import data
> from a spreadsheet. I'm using exactly what works fine on Windows, namely:
>
> 1 save the file from Excel as tab-delimited, say called "test.txt",
> with the variable names in the first row.
> 2 Read in into R with
> test<-read.table("test.txt", header=T)
>
> It does weird things, especially if any variables are characters. For
> example, it has omitted the 5th observation for the 1st variable, and
> then appended it to the first variable name. I've tried read.csv with
> csv files, read.delim, etc. None seem to work. Am I being really silly,
> and if so, how do you do it? Or is there an easier way to get data into
> the mac port? Or is the mac port entirely useless?
>
> Can anyone out there help?
>
> Thanks
>
> Hamish McCallum
>
> --
> Dr Hamish McCallum
> Department of Zoology and Entomology
> The University of Queensland
> Brisbane 4072
> Australia
> Phone (+617) 3365 2450 Fax (+617) 3365 1655
>
> ______________________________________________
> R-help@stat.math.ethz.ch mailing list
> http://www.stat.math.ethz.ch/mailman/listinfo/r-help
>

______________________________________________
R-help@stat.math.ethz.ch mailing list
http://www.stat.math.ethz.ch/mailman/listinfo/r-help


About this list Date view Thread view Subject view Author view Attachment view

This archive was generated by hypermail 2.1.3 : Tue 01 Jul 2003 - 09:11:19 EST