Skip to content
Back to formatted view

Raw Message

Message-ID: <0A83C25F-DC57-40FC-B16D-0A276A79DC77@comcast.net>
Date: 2012-08-15T23:07:30Z
From: David Winsemius
Subject: Import Data from Excel
In-Reply-To: <CAHLnndZC2zGiSBSSV6Mn5_gOkhPx4TATEGixV-ffZas4O8tCoA@mail.gmail.com>

On Aug 15, 2012, at 2:04 PM, li li wrote:

> Dear all,
>   I want to import just part of an excel data file into R.
>   I would like to have the data imported without
> rownames or colume names.
>  I used read.delim("clipboard", header=F).  Somehow even though
> I added the argument "header=F", I still have the row names V1,  
> V2, ...,
> Does anyone know how to fix this?
>   Thanks very much in advance.

You could use readLines() or you could use scan().

Perhaps:

input <- scan(file="clipboard", what="numeric")

If you know the number of columns, say 10, it could be:

inpmat <- matrix( scan(file="clipboard", what="numeric"), ncol=10)

-- 
David Winsemius, MD
Alameda, CA, USA