---
> *From:* Bert Gunter
> *Sent:* Thursday, October 24, 2019 10:39
> *To:* Sebastien Bihorel
> *Cc:* r-help@r-project.org
> *Subject:* Re: [R] read.table and NaN
>
> Not so. Read ?read.table carefully. You can use "NA" as a default.
> Moreover, y
nter
Sent: Thursday, October 24, 2019 10:39
To: Sebastien Bihorel
Cc: r-help@r-project.org
Subject: Re: [R] read.table and NaN
Not so. Read ?read.table carefully. You can use "NA" as a default. Moreover,
you **specified** that you want NaN read as character, which means that any
c
> read.table call accordingly. I am working on a framework that is meant to
>> process data files with unknown structure, so I have to think a bit more
>> about that...
>> --
>> *From:* Bert Gunter
>> *Sent:* Thursday, October 24, 2019 00:08
>> *To:* Sebastien Bi
amework that is meant to
> process data files with unknown structure, so I have to think a bit more
> about that...
> --
> *From:* Bert Gunter
> *Sent:* Thursday, October 24, 2019 00:08
> *To:* Sebastien Bihorel
> *Cc:* r-help@r-project.org
> *Subject:*
Gunter
Sent: Thursday, October 24, 2019 00:08
To: Sebastien Bihorel
Cc: r-help@r-project.org
Subject: Re: [R] read.table and NaN
Like this?
con <- textConnection(object = 'A,B\n1,NaN\nNA,2')
> tmp <- read.table(con, header = TRUE, sep = ',', na.strings = '',
> stringsAsFac
Like this?
con <- textConnection(object = 'A,B\n1,NaN\nNA,2')
> tmp <- read.table(con, header = TRUE, sep = ',', na.strings = '',
stringsAsFactors = FALSE,
+ colClasses = c("numeric", "character"))
> close.connection(con)
> tmp
A B
1 1 NaN
2 NA 2
> class(tmp[,1])
[1]
Hi,
Is there a way to make read.table consider NaN as a string of characters rather
than the internal NaN? Changing the na.strings argument does not seems to have
any effect on how R interprets the NaN string (while is does not the the NA
string)
con <- textConnection(object =
e correct, my
> example was slightly malformed and in fact gives an error under R
> version 3.2.2. Please allow me to try again; in older versions of R,
> > read.table(file = textConnection("a\t3.14"), header = FALSE,
> colClasses = c(x = "cha
ile' argument
> points to a file on disk with a million lines. But you are correct, my
> example was slightly malformed and in fact gives an error under R
> version 3.2.2. Please allow me to try again; in older versions of R,
> > read.table(file = textConnection("a\
. Please allow me to try again; in older versions of R,
> read.table(file = textConnection("a\t3.14"), header = FALSE,
colClasses = c(x = "character", y = "numeric"), sep="\t")
V1 V2
1 a 3.14
(with no warning). As of version 3.3.0,
You are constructing the equivalent of a two-line data file, and complaining
that it is not treating it like it was one line. If it did used to accept this
silently [skeptical] then I for one am glad it produces a warning now.
--
Sent from my phone. Please excuse my brevity.
On October 23,
Hello
I noticed that starting with R version 3.3.0 onward, this generates a
warning:
> txt <- c("a", "3.14")
> read.table(file = textConnection(txt), header = FALSE, colClasses
= c(x = "character", y = "numeric"))
the warning is "not all columns named in 'colClasses' exist" and I
On Wed, 19 Oct 2016, Duncan Murdoch wrote:
I don't get that from those 9 observations, so there's likely something
else going on further down in the file.
Duncan,
Sigh. I thought I had removed all 'T's (for trace amounts) from the file,
but I hadn't.
Yes, this explains it.
Many thanks,
> On Oct 19, 2016, at 4:12 PM, David Winsemius wrote:
>
>
>> On Oct 19, 2016, at 1:54 PM, Rich Shepard wrote:
>>
>> The file, daily_records.dat, contains these data:
>>
>> "station","date","amount"
>> "0.3E",2014-01-01,
>> "0.3E",2014-01-02,
On 19/10/2016 4:54 PM, Rich Shepard wrote:
The file, daily_records.dat, contains these data:
"station","date","amount"
"0.3E",2014-01-01,
"0.3E",2014-01-02,
"0.3E",2014-01-03,0.01
"0.3E",2014-01-04,0.00
"0.3E",2014-01-05,0.00
"0.3E",2014-01-06,0.00
"0.3E",2014-01-07,0.10
The file, daily_records.dat, contains these data:
"station","date","amount"
"0.3E",2014-01-01,
"0.3E",2014-01-02,
"0.3E",2014-01-03,0.01
"0.3E",2014-01-04,0.00
"0.3E",2014-01-05,0.00
"0.3E",2014-01-06,0.00
"0.3E",2014-01-07,0.10
"0.3E",2014-01-08,0.22
"0.3E",2014-01-09,0.49
Using
On 01/04/2015 09:52, Thomas wrote:
Hi,
Is there a way to create memory connections in R which are valid
connections to read.table (and associated function)? By saying memory
connection I refer to something like a connection created from a simple
character object (of length 1) - instead of
Hi,
Is there a way to create memory connections in R which are valid
connections to read.table (and associated function)? By saying memory
connection I refer to something like a connection created from a simple
character object (of length 1) - instead of having the content in a
physical file
On 01/04/2015 11:06, Prof Brian Ripley wrote:
On 01/04/2015 09:52, Thomas wrote:
Hi,
I believe you are looking for 'text connections': see the 'text'
argument to read.table() and ?textConnection.
Thanks, that's it !
__
R-help@r-project.org
To which I will add, you could have tried
count.fields('test.dat', sep='$' )
which I expect would have given you 3,3,2,3, and hence a pointer to where
the problem is.
count.fields is mentioned in the See Also section of ?read.table
--
Don MacQueen
Lawrence Livermore National Laboratory
Hello,
You're missing a dollar sign: 2$$$5, not 2$$5.
Hope this helps,
Rui Barradas
Em 11-02-2015 14:53, Tim Victor escreveu:
All,
Assume we have data in an ASCII file that looks like
Var1$Var2$Var3$Var4
1$2$3$4
2$$5
$$$6
When I execute
read.table( 'test.dat', header=TRUE, sep='$' )
I,
All,
Assume we have data in an ASCII file that looks like
Var1$Var2$Var3$Var4
1$2$3$4
2$$5
$$$6
When I execute
read.table( 'test.dat', header=TRUE, sep='$' )
I, of course, receive the following error:
Error in scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings,
:
line 2 did
Thanks!!
On Mon, Jan 26, 2015 at 5:23 PM, peter dalgaard pda...@gmail.com wrote:
On 26 Jan 2015, at 23:10 , Duncan Murdoch murdoch.dun...@gmail.com
wrote:
read.table(other args as before, colClasses = character)
(You might want factor instead of character.)
Or maybe not. I'd expect
Hi,
I had a table with 'T's in it. When I try to read the table, it replaces
all the 'T's with TRUE. Is there a way that I can retain the Ts?
thanks!
Sample table (test.txt):
xx1 xx2 0 0 2 2 A A G G A G A A C C G G G G G G A G A A A G A G A A G G A A
A G G G A G A G G G A G A G G G G G A G G
On 26/01/2015 4:52 PM, Brian Smith wrote:
Hi,
I had a table with 'T's in it. When I try to read the table, it replaces
all the 'T's with TRUE. Is there a way that I can retain the Ts?
That only happens for columns which are all T. (You only have one row,
so every T gets converted.) The
On 26 Jan 2015, at 23:10 , Duncan Murdoch murdoch.dun...@gmail.com wrote:
read.table(other args as before, colClasses = character)
(You might want factor instead of character.)
Or maybe not. I'd expect trouble with getting the levels set to
c(C,A,G,T) for all columns.
Is this always one
Stanford, California 94305-5324
- Original Message -
From: Henrik Bengtsson h...@biostat.ucsf.edu
To: Stephen HK Wong hon...@stanford.edu
Cc: r-help@r-project.org
Sent: Thu, 18 Sep 2014 18:33:15 -0700 (PDT)
Subject: Re: [R] read.table() 1Gb text dataframe
As a start, make sure you
When working with datasets too large to fit in memory it is usually
best to use an actual database, read the data into the database, then
pull the records that you want into R. There are several packages for
working with databases, but 2 of the simplest are the RSQLite and
sqldf packages
on
documentation.
Stephen HK Wong
Stanford, California 94305-5324
- Original Message -
From: Henrik Bengtsson h...@biostat.ucsf.edu
To: Stephen HK Wong hon...@stanford.edu
Cc: r-help@r-project.org
Sent: Thu, 18 Sep 2014 18:33:15 -0700 (PDT)
Subject: Re: [R] read.table() 1Gb text dataframe
Dear All,
I have a table of 4 columns and many millions rows separated by tab-delimited.
I don't have enough memory to read.table in that 1 Gb file. And actually I have
12 text files like that. Is there a way that I can just randomly read.table()
in 10% of rows ? I was able to do that using
As a start, make sure you specify the 'colClasses' argument. BTW,
using that you can even go to the extreme and read one column at the
time, if it comes down to that.
To read a 10% subset of the rows, you can use R.filesets as:
library(R.filesets)
db - TabularTextFile(pathname)
n -
r code for the packages cstmr ,gRain,gRc,gRim,gRbase using probability models,
On Friday, September 19, 2014 7:05 AM, Henrik Bengtsson h...@biostat.ucsf.edu
wrote:
As a start, make sure you specify the 'colClasses' argument. BTW,
using that you can even go to the extreme and read one
Hello Uwe Others
Thanks for all your help, I figured out what the problem was. It wasn't
working with old R version. Once I updated it to the latest version, it
seemed to work.
Thank you
--
View this message in context:
-project.org
Date: 19/04/2014 14:05
Subject:Re: [R] Read.table mucks up headers
On 19.04.2014 14:30, starter wrote:
Hello Milan
It had worked perfectly before, but now I am trying on a different text
file
but using the trick you showed I just get the headers in the output and
that
too
Hello Uwe
I tried both the options you mentioned but all i get as output then is the
header line and the headers as row.names and X.
--
View this message in context:
http://r.789695.n4.nabble.com/Read-table-mucks-up-headers-tp4688742p4689185.html
Sent from the R help mailing list archive at
Hello Milan
It had worked perfectly before, but now I am trying on a different text file
but using the trick you showed I just get the headers in the output and that
too as row.names and X.
*code:*
corr - read.table(E:/temp/corrosion
data.txt,header=T,fileEncoding=UTF-8-BOM)
dput(corr)
On 19.04.2014 14:30, starter wrote:
Hello Milan
It had worked perfectly before, but now I am trying on a different text file
but using the trick you showed I just get the headers in the output and that
too as row.names and X.
*code:*
corr - read.table(E:/temp/corrosion
Thank you Milan, the fileEncoding bit worked perfectly.
From: Milan Bouchet-Valat nalimi...@club.fr
To: Jeff Newmiller jdnew...@dcn.davis.ca.us
Cc: Pavneet Arora/UK/RoyalSun@RoyalSun, r-help@r-project.org,
pavnee...@yahoo.co.uk
Date: 14/04/2014 18:03
Subject:Re: [R
Hey All
I am trying to read in a small text file using read.table.
dput(sim)
structure(list(ï...X. = 1:7, Y1 = c(2.5501, 4.105, 5.4687, 7.0009,
8.5066, 9.785, 11.5167), Y2 = c(2.5501, 4.105, 5.4687, 11.0009,
8.5066, 9.785, 11.5167), Y3 = c(2.5501, 4.105, 5.4687, 7.0009,
8.5066, 9.785,
You have not posted the input to your code so it is not reproducible. Also, you
have posted in HTML, which is notorious for corrupting R code and data in
emails.
If I were to guess, though, it looks to me like you are working with a UTF-8
file with a Byte Order Mark (header). I don't know the
But for some reason my first header comes as ?...X. , instead of just X.
Can some one please tell me why? And how to fix it?
i) What were the separator characters in the original data file header row?
ii) Your first character is not being decoded properly; check the file encoding
and set
Le lundi 14 avril 2014 à 08:50 -0700, Jeff Newmiller a écrit :
You have not posted the input to your code so it is not reproducible.
Also, you have posted in HTML, which is notorious for corrupting R
code and data in emails.
If I were to guess, though, it looks to me like you are working
-Original Message-
I have a txt file to read into R. The size of it is about 500MB.
This txt file is produced by calling write.table(M, file =
xxx.txt), where M is a large matrix After running MM =
read.table(xxx.txt), the R gui keeps a cpu core/thread
fully occupied forever.
Jie jimmycloud at gmail.com writes:
[snip]
I have a txt file to read into R. The size of it is about 500MB.
This txt file is produced by calling write.table(M, file =
xxx.txt), where M is a large matrix
After running MM = read.table(xxx.txt), the R gui keeps a cpu
core/thread fully
Hi List,
I have spent more than 30 minutes, but failed to read in this file using the
read.table() function. I could not figure out how to fix the following error.
Error in scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings, :
line 1 did not have 6 elements
Any help would be
On 08/12/2012 19:10, Muhuri, Pradip (SAMHSA/CBHSQ) wrote:
Hi List,
I have spent more than 30 minutes, but failed to read in this file using the
read.table() function. I could not figure out how to fix the following error.
Well, we have a whole manual on this, mentioned on ?read.table (see
-project.org
Subject: [R] read.table()
Hi List,
I have spent more than 30 minutes, but failed to read in this file
using the read.table() function. I could not figure out how to fix the
following error.
Error in scan(file, what, nmax, sep, dec, quote, skip, nlines,
na.strings, : line 1 did
Hi!
I think you have problem with flag_var. I suggest to put just
flagvar. Do not use _ in variable names. I would suggest not to
use both _ or - anywhere in data file. I am just a beginner with R
but think that is the problem...
Cheers!
Tanja.
On Sat, Dec 8, 2012 at 8:29 PM, Prof Brian Ripley
read.table(data.txt,header=TRUE,
colClasses=c(character,character,numeric,character,
numeric,numeric))
a b c d e f
1 SPX LSZ 100 C 0 34.40
2 SPX LSZ 100 P 0 1.30
3 SPX LSZ 105 C 0 30.30
4 SPX LSZ 105 P 0 1.85
5 SPX LSZ 110 C 0 26.40
It's right result! header=TRUE,not header=T. I
On 19.11.2012 08:07, li1127217ye wrote:
read.table(data.txt,header=TRUE,
colClasses=c(character,character,numeric,character,
numeric,numeric))
a b c d e f
1 SPX LSZ 100 C 0 34.40
2 SPX LSZ 100 P 0 1.30
3 SPX LSZ 105 C 0 30.30
4 SPX LSZ 105 P 0 1.85
5 SPX LSZ 110 C 0 26.40
It's
Hi
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-bounces@r-
project.org] On Behalf Of li1127217ye
Sent: Monday, November 19, 2012 8:08 AM
To: r-help@r-project.org
Subject: Re: [R] read.table
read.table(data.txt,header=TRUE,
colClasses=c(character
Yesterday I changed the headers for a couple of columns in data text files
and removed hyphens from within character strings, too. When I tried to
re-read these data sources using read.table() I encountered an issue I've
not before seen. Both files were read almost instantly until yesterday's
On Wed, 1 Aug 2012, Rich Shepard wrote:
What might cause this?
I restored these two files from last Friday and they are read into R with
no problems. So, I'll make one change at a time and see where things break.
Will post results when I have them.
Rich
-project.org [mailto:r-help-boun...@r-project.org] On
Behalf
Of Rich Shepard
Sent: Wednesday, August 01, 2012 10:52 AM
To: r-help@r-project.org
Subject: [R] read.table() Issue
Yesterday I changed the headers for a couple of columns in data text files
and removed hyphens from within character
On Wed, 1 Aug 2012, Rich Shepard wrote:
What might cause this?
Must be computers acting like computers. Restored files from backup, made
changes one at a time, and there are no problems reading them into R data
frames. My apologies for taking up space here.
Rich
On Wed, 1 Aug 2012, William Dunlap wrote:
An unmatched quote can make read.table run very slowly when there are lots
of lines in the file. E.g.,
Bill,
Yes. Turns out that there was no closing quote on a changed header. I
found this by an error message on one data file; the other data file
: peter dalgaard pda...@gmail.com
To: arun smartpink...@yahoo.com
Cc: kexinz zhangchic...@gmail.com; R help r-help@r-project.org
Sent: Friday, July 13, 2012 10:27 AM
Subject: Re: [R] read.table with numeric row names
On Jul 13, 2012, at 04:27 , arun wrote:
Hello,
I saw your reply in nabble
.
- Original Message -
From: kexinz zhangchic...@gmail.com
To: r-help@r-project.org
Cc:
Sent: Thursday, July 12, 2012 2:50 PM
Subject: [R] read.table with numeric row names
I have a text file like this
2.5 3.6 7.1 7.9
100 3 4 2 3
200 3.1 4
7.9
On Thu, Jul 12, 2012 at 2:50 PM, kexinz zhangchic...@gmail.com wrote:
I have a text file like this
2.5 3.6 7.1 7.9
100 3 4 2 3
200 3.1 4 3 3
300 2.2 3.3 2 4
I used r - read.table(a.txt, header=T)
The row names becomes X2.5, X3.6
-project.org [mailto:r-help-boun...@r-project.org] On
Behalf Of kexinz
Sent: Thursday, July 12, 2012 2:59 PM
To: r-help@r-project.org
Subject: Re: [R] read.table with numeric row names
Thanks Yasir, this helps a lot.
BTW, is there an R command to read just the first line of the file
Thanks all you guys' help!
--
View this message in context:
http://r.789695.n4.nabble.com/read-table-with-numeric-row-names-tp4636342p4636446.html
Sent from the R help mailing list archive at Nabble.com.
__
R-help@r-project.org mailing list
, 2012 10:27 AM
Subject: Re: [R] read.table with numeric row names
On Jul 13, 2012, at 04:27 , arun wrote:
Hello,
I saw your reply in nabble. Sorry about that. I thought the dataset had
only few columns.
#You can read first line of a file using:
readLines(foo.txt,n=1)[1
I have a text file like this
2.5 3.6 7.1 7.9
100 3 4 2 3
200 3.1 4 3 3
300 2.2 3.3 2 4
I used r - read.table(a.txt, header=T)
The row names becomes X2.5, X3.6... What I need is the row names are
numeric, so I can use the row names as numbers
] read.table with numeric row names
I have a text file like this
2.5 3.6 7.1 7.9
100 3 4 2 3
200 3.1 4 3 3
300 2.2 3.3 2 4
I used r - read.table(a.txt, header=T)
The row names becomes X2.5, X3.6... What I need is the row names are
numeric, so I can use
just do this:
colnames(r)-substr(colnames(r),2,nchar(colnames(r)))
This will remove the X.
Later when you want to use the headed to plot something, cast it as numeric:
plot(colMeans(r)~as.numeric(colnames(r)))
-
Yasir Kaheil
--
View this message in context:
Thanks, but I don't want to specify the column names by hand, since I have a
lot of similar files.
arun kirshna wrote
Hi,
Try this:
dat1-read.table(text=
2.5 3.6 7.1 7.9
100 3 4 2 3
200 3.1 4 3 3
300 2.2 3.3 2 4
,sep=,header=TRUE)
#Either
Thanks Yasir, this helps a lot.
BTW, is there an R command to read just the first line of the file?
Yasir Kaheil wrote
just do this:
colnames(r)-substr(colnames(r),2,nchar(colnames(r)))
This will remove the X.
Later when you want to use the headed to plot something, cast it as
numeric:
)),xlab=Column_Name,ylab=Column_Mean)
A.K.
- Original Message -
From: kexinz zhangchic...@gmail.com
To: r-help@r-project.org
Cc:
Sent: Thursday, July 12, 2012 2:50 PM
Subject: [R] read.table with numeric row names
I have a text file like this
2.5 3.6 7.1 7.9
100 3 4
Subject: [R] read.table with numeric row names
I have a text file like this
2.5 3.6 7.1 7.9
100 3 4 2 3
200 3.1 4 3 3
300 2.2 3.3 2 4
I used r - read.table(a.txt, header=T)
The row names becomes X2.5, X3.6... What I need is the row
Hi,
I am trying to read in weather balloon data, where each file has a header of
fixed length and
a trailing section of a fixed length. The data section (the table) is of
variable length.
An example of the data is on:
On Jun 14, 2012, at 10:23 AM, Halldór Björnsson wrote:
Hi,
I am trying to read in weather balloon data, where each file has a
header of fixed length and
a trailing section of a fixed length. The data section (the table)
is of variable length.
An example of the data is on:
On Jun 14, 2012, at 12:18 PM, Halldór Björnsson wrote:
Thanks and with
datlines - as.data.frame(inp[( grep(PRE, inp)[1]+5 ):(grep(/
PRE, inp)[1]-1)]);
I suggest this instead.
read.fwf(textConnection(datlines), widths=rep(7,11))
V1V2V3V4 V5 V6 V7 V8V9 V10
On Jun 14, 2012, at 12:18 PM, Halldór Björnsson wrote:
Thanks and with
datlines - as.data.frame(inp[( grep(PRE, inp)[1]+5 ):(grep(/
PRE, inp)[1]-1)]);
Er, ... are you sure? I got a factorized mess when I did that.
str(datlines)
'data.frame': 98 obs. of 1 variable:
$ inp[(grep(PRE,
Thanks,
even better
- Original Message -
On Jun 14, 2012, at 12:18 PM, Halldór Björnsson wrote:
Thanks and with
datlines - as.data.frame(inp[( grep(PRE, inp)[1]+5 ):(grep(/
PRE, inp)[1]-1)]);
I suggest this instead.
read.fwf(textConnection(datlines), widths=rep(7,11))
V1 V2
Thanks and with
datlines - as.data.frame(inp[( grep(PRE, inp)[1]+5 ):(grep(/PRE,
inp)[1]-1)]);
I get the data as needed.
Thanks again
H.
- Original Message -
On Jun 14, 2012, at 10:23 AM, Halldór Björnsson wrote:
Hi,
I am trying to read in weather balloon data, where each file
Hi,
I have a tab seperated file with 206 rows and 30 columns.
I read in the file into R using read.table() function. I checked the dim()
of the data frame created in R, it had only 103 rows (exactly half), 30
columns. Then I tried reading in the file using read.delim() function and
this time the
read.delim calls read.table so any differences between the two are
caused by differences in the default values of some of the parameters.
Take a look at the help file ?read.table
read.table uses white space as separator; read.delim tabs
read.table uses and ' as quotes; read.delim just
On May 4, 2012, at 08:16 , Rameswara Sashi Kiran Challa wrote:
Hi,
I have a tab seperated file with 206 rows and 30 columns.
I read in the file into R using read.table() function. I checked the dim()
of the data frame created in R, it had only 103 rows (exactly half), 30
columns. Then I
Thanks Peter.
In my case specifying the quote=\ worked out fine with read.table().
-Sashi
On Fri, May 4, 2012 at 1:53 PM, peter dalgaard pda...@gmail.com wrote:
On May 4, 2012, at 08:16 , Rameswara Sashi Kiran Challa wrote:
Hi,
I have a tab seperated file with 206 rows and 30 columns.
use the 'comment.char' parameter of read.table
Sent from my iPad
On Mar 1, 2012, at 17:51, Rui Barradas rui1...@sapo.pt wrote:
Hello,
The problem is that I get a the following error bacause anything after the
# is ignored.
Error in scan(file, what, nmax, sep, dec, quote, skip, nlines,
The # is the default comment character in read.table(), but that can
easily be changed:
tc - textConnection(
+ yes yes yes yes yes
+ yes yes yes yes yes
+ yes yes # yes yes
+ )
x - read.table(tc, comment.char=)
x
V1 V2 V3 V4 V5
1 yes yes yes yes yes
2 yes yes yes yes yes
3 yes yes #
Hello,
The problem is that I get a the following error bacause anything after the
# is ignored.
Error in scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings,
:
line 6 did not have 500 elements
R thinks that line 6 has only 2 elements because of the #.
Use
I get this error from read.table():
Error in scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings, :
line 234 did not have 8 elements
The error is genuine (an extra field separator between 1st and 2nd element).
1. is there a way to see this bad line 234 from R without diving into
On 24/01/2012 3:45 PM, Sam Steingold wrote:
I get this error from read.table():
Error in scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings, :
line 234 did not have 8 elements
The error is genuine (an extra field separator between 1st and 2nd element).
1. is there a way to see
Given your domain name, you might also get some use out of the
system() and system2() commands which allow the passing of strings to
the OS command line (and thus the use of tools like grep/sed/awk
within R)
E.g., an idiom I use pretty frequently for interactive data analysis:
(not really
On 25/01/12 09:45, Sam Steingold wrote:
I get this error from read.table():
Error in scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings, :
line 234 did not have 8 elements
The error is genuine (an extra field separator between 1st and 2nd element).
1. is there a way to see
* Duncan Murdoch zheqbpu.qha...@tznvy.pbz [2012-01-24 16:00:14 -0500]:
On 24/01/2012 3:45 PM, Sam Steingold wrote:
I get this error from read.table():
Error in scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings, :
line 234 did not have 8 elements
The error is genuine (an
-project.org [mailto:r-help-boun...@r-project.org] On
Behalf Of R. Michael
Weylandt
Sent: Tuesday, January 24, 2012 1:33 PM
To: s...@gnu.org
Cc: r-help@r-project.org
Subject: Re: [R] read.table: how to ignore errors?
Given your domain name, you might also get some use out of the
system
* William Dunlap jqha...@gvopb.pbz [2012-01-24 21:47:39 +]:
Oh, yeah, a reproducible example:
read.csv from
=
a,b
1,2
3,4
5,,6
7,8
=
I want to be able to extract the data frame
a b
1 1 1
The previous line should be '1 1 2', right?
of course, thanks!
Hello,
I have a csv file with many variables, both characters and integers.
I would like to load it on R and do some operations on integer
variables, the problem is that R loads the entire dataset considering
all variables as characters, instead I would like that R makes the
distinction
On Jan 13, 2012, at 7:02 AM, Francisco wrote:
Hello,
I have a csv file with many variables, both characters and integers.
I would like to load it on R and do some operations on integer
variables, the problem is that R loads the entire dataset
considering all variables as characters,
On Fri, Jan 13, 2012 at 7:02 AM, Francisco franciscororol...@google.com wrote:
Hello,
I have a csv file with many variables, both characters and integers.
I would like to load it on R and do some operations on integer variables,
the problem is that R loads the entire dataset considering all
?t
Re: [R] read.table performance
On Dec 7, 2011, at 22:37 , R. Michael Weylandt wrote:
R 2.13.2 on Mac OS X 10.5.8 takes about 1.8s to read the file
verbatim: system.time(read.table(test2.txt))
About 2.3s with 2.14 on a 1.86 GHz MacBook Air 10.6.8.
Gene, are you by any chance
Thanks All!
On Thu, Dec 8, 2011 at 7:41 PM, Robert Baer rb...@atsu.edu wrote:
Hello All,
This works,
results - read.table(plink.txt,T)
while this doesn't.
results - read.table(plink.txt)
The T is the value for the second parameter which you show from the help
file
-boun...@r-project.org
07.12.2011 23:11
Komu
R. Michael Weylandt michael.weyla...@gmail.com
Kopie
r-help@r-project.org, Gene Leynes gley...@gmail.com
Předmět
Re: [R] read.table performance
On Dec 7, 2011, at 22:37 , R. Michael Weylandt wrote:
R 2.13.2 on Mac OS X 10.5.8
: [R] read.table performance
On Dec 7, 2011, at 22:37 , R. Michael Weylandt wrote:
R 2.13.2 on Mac OS X 10.5.8 takes about 1.8s to read the file
verbatim: system.time(read.table(test2.txt))
About 2.3s with 2.14 on a 1.86 GHz MacBook Air 10.6.8.
Gene, are you by any chance storing
R. Michael Weylandt michael.weyla...@gmail.com
Kopie
r-help@r-project.org, Gene Leynes gley...@gmail.com
P?edm?t
Re: [R] read.table performance
On Dec 7, 2011, at 22:37 , R. Michael Weylandt wrote:
R 2.13.2 on Mac OS X 10.5.8 takes about 1.8s to read the file
verbatim
Hello All,
This works,
results - read.table(plink.txt,T)
while this doesn't.
results - read.table(plink.txt)
Make sure your data frame contains columns CHR, BP, and P
What does adding the T in read.table do? Which argument does this
correspond to? I tried searching for it but didn't find the
On 08/12/2011 3:28 PM, Pavan G wrote:
Hello All,
This works,
results- read.table(plink.txt,T)
while this doesn't.
results- read.table(plink.txt)
Make sure your data frame contains columns CHR, BP, and P
What does adding the T in read.table do? Which argument does this
correspond to? I tried
Hello All,
This works,
results - read.table(plink.txt,T)
while this doesn't.
results - read.table(plink.txt)
The T is the value for the second parameter which you show from the help
file printout you looked at to be header. Thus, you are writing in short
cut:
results -
1 - 100 of 278 matches
Mail list logo