2006 08:52:04 -0500
From: "Carl Klarner" <[EMAIL PROTECTED]>
To:
Subject: [R] How to Import Data
> Hello,
> I am a very new user of R. I've spent several hours trying to import
> data, so I feel okay asking the li
On 2/21/2006 9:13 AM, Adaikalavan Ramasamy wrote:
> 1) You need to use sep="," which is appropriate for a CSV file.
>
> 2) You need to specify the FULL path to the file. See
> http://cran.r-project.org/bin/windows/base/rw-FAQ.html#R-can_0027t-find-my-file
The advice to look at the FAQ is good, b
On Tue, Feb 21, 2006 at 08:52:04AM -0500, Carl Klarner wrote:
> x111 <-read.table(file='x111.csv',
> sep="",header=T,
> quote="",comment.char="",as.is=T)
to make things easier for you you could do
x111 <-read.table( file.choose(), ... )
Also: Why are you setting sep="" ? Your filename suggests
Or, you should put the whole path to that file, for example
file='C:/My documents/x111.csv'
Best,
Ales Ziberna
Johann Jacoby pravi:
> carl,
>
> you wrote:
>
>
>> I would imagine I'm not putting my csv file in the right location for R
>> to be able to read it. If that's the case, where shoul
1) You need to use sep="," which is appropriate for a CSV file.
2) You need to specify the FULL path to the file. See
http://cran.r-project.org/bin/windows/base/rw-FAQ.html#R-can_0027t-find-my-file
3) You can use read.csv which is the read.table variant for CSV files.
For example
a <- read.
Carl Klarner isugw.indstate.edu> writes:
>
> I would imagine I'm not putting my csv file in the right location for R
> to be able to read it. If that's the case, where should I put it? Or
> is there something else I need to do to it first?
> Thanks for your help,
> Carl
You're probably righ
select the directory with setwd() and then import data:
setwd("d:/.../yourdirectory")
x111 <- read.table("x111.csv",...)
or indicate path behind filename:
x111 <- read.table("d:/.../yourdirectory/x111.csv",...)
besides, there are other functions to import data.
see ?read.table
Carl Klarner a
carl,
you wrote:
> I would imagine I'm not putting my csv file in the right location for R
> to be able to read it. If that's the case, where should I put it? Or
> is there something else I need to do to it first?
getwd() gives you the working directory in which the datafile has to
reside.
jo
Hello,
I am a very new user of R. I've spent several hours trying to import
data, so I feel okay asking the list for help. I had an Excel file,
then I turned it into a "csv" file, as instructed by directions. My
filename is "x111.csv." I then used the following commands to read this
(fairly sma
maybe you can use the array function,like
>array(CO2,dim(CO2),list(rownames(CO2),colnames(CO2)))
and matrix is just a specif type of array,so maybe you can use as.matrix
>as.matrix(CO2)
the above tow,the CO2 is a data.frame which can use read.table to read in.
the third way is:use the scan the re
Please consult the `R Data Import/Export Manual'. You could be using
scan(), as in
matrix(scan("some_file", 0), nrow=n, byrow=TRUE)
On Tue, 28 Jun 2005, tong wang wrote:
> Did some search but couldn't find useful result.
>
> I am trying to read a n*m dimension data with read.table, what i n
Did some search but couldn't find useful result.
I am trying to read a n*m dimension data with read.table, what i need is a
numeric array,
is there any efficient way to allow me get this array directly instead of a
list?
I tried to use as.array() to change the mode, but seems it doesn't work
12 matches
Mail list logo