Re: [R] write.table: adapt end of line

2016-02-26 Thread Ulrik Stervbo
You could also use kable from the Knitr package Best, Ulrik On Fri, 26 Feb 2016 at 11:17 Uwe Ligges wrote: > writeLines(paste(do.call(paste, c(liste, sep=" & ")), "\\hline"), > con = "empf.csv") > > Best, > Uwe Ligges > > > > On 26.02.2016 11:06, Ferri Leberl wrote: > > > > > > Hi everyone!

Re: [R] write.table: adapt end of line

2016-02-26 Thread Uwe Ligges
writeLines(paste(do.call(paste, c(liste, sep=" & ")), "\\hline"), con = "empf.csv") Best, Uwe Ligges On 26.02.2016 11:06, Ferri Leberl wrote: Hi everyone! I want to include a table into LaTeX. I have a fitting environment and don't want to deal with xtable, so only the core of the ta

[R] write.table: adapt end of line

2016-02-26 Thread Ferri Leberl
Hi everyone!   I want to include a table into LaTeX. I have a fitting environment and don't want to deal with xtable, so only the core of the table should be exported with something like   write.table(liste,"empf.csv",sep="&",quote=FALSE,row.names=F)   What I need is a way to end every row with

Re: [R] write.table with append=T after using cat on same file

2015-07-28 Thread PIKAL Petr
Scott R > Sent: Monday, July 27, 2015 10:32 PM > To: R. Help > Subject: [R] write.table with append=T after using cat on same file > > Hi, > > For years I've been writing text to the beginning of files with > cat(append=F) , then following that text with data written by &

Re: [R] write.table with append=T after using cat on same file

2015-07-27 Thread William Dunlap
Missing words: Use 'TRUE' and 'FALSE' instead of 'T' and 'F' >to avoid< this sort of problem Bill Dunlap TIBCO Software wdunlap tibco.com On Mon, Jul 27, 2015 at 1:50 PM, William Dunlap wrote: > This will happen if you have redefined 'T': > > T <- 101:104 > > write.table(df, file="junk.tx

Re: [R] write.table with append=T after using cat on same file

2015-07-27 Thread William Dunlap
This will happen if you have redefined 'T': > T <- 101:104 > write.table(df, file="junk.txt", sep=",", append=T, quote=F, row.names=F, col.names=F) Error in file(file, ifelse(append, "a", "w")) : invalid 'open' argument Use 'TRUE' and 'FALSE' instead of 'T' and 'F' this sort of problem. Bil

Re: [R] write.table with append=T after using cat on same file

2015-07-27 Thread Mark Sharp
I do not get an error with R-3.2.1 on Mac OS. You may have done something prior to this code so that perhaps F is not FALSE or T is not TRUE. R. Mark Sharp, Ph.D. msh...@txbiomed.org > On Jul 27, 2015, at 3:32 PM, Waichler, Scott R > wrote: > > Hi, > > For years I've been writing text t

[R] write.table with append=T after using cat on same file

2015-07-27 Thread Waichler, Scott R
Hi, For years I've been writing text to the beginning of files with cat(append=F) , then following that text with data written by write.table(append=T). It is now giving me an error message. I'm using R-3.1.2. What gives? df <- data.frame(x = 1, y = 1:10, z = 10:1) cat(file="junk.txt", sep=

Re: [R] write.table produces a file that read.table can't read

2014-10-08 Thread MacQueen, Don
How about: tmp <- data.frame(a=1:3, b=c("a", "b\"b", "c")) write.table(tmp, './tmp.write', row.names=FALSE, sep="\t², quote=FALSE) tmp.in <- read.table('./tmp.write', sep='\t', head=TRUE, quote="") > all.equal(tmp, tmp.in) [1] TRUE -Don -- Don MacQueen Lawrence Livermore National Labora

[R] write.table produces a file that read.table can't read

2014-10-08 Thread Neal H. Walfield
Hi, I'm using R version 3.1.1 on Debian via the CRAN repositories. Consider the following MWE that writes a data.frame out to a file and reads it back in (note that one of the strings contains a double quote): > write.table(data.frame(a=1:3, b=c("a", "b\"b", "c")), '/tmp/a', row.names=FALSE,

Re: [R] write.table and append

2013-02-08 Thread Brian Smith
Ah, I didn't know this! Thanks Ben. On Fri, Feb 8, 2013 at 10:18 AM, Ben Tupper wrote: > Hi, > > On Feb 8, 2013, at 9:40 AM, Brian Smith wrote: > > > Hi, > > > > I am trying to append tables on file with this sample code: > > > >for(i in 1:2){ > >mat <- data.frame(sample(1:30

Re: [R] write.table and append

2013-02-08 Thread Ben Tupper
Hi, On Feb 8, 2013, at 9:40 AM, Brian Smith wrote: > Hi, > > I am trying to append tables on file with this sample code: > >for(i in 1:2){ >mat <- data.frame(sample(1:30,9),3,3) >colnames(mat) <- letters[1:3] >ifelse(i == > 1,write.table(mat,paste('te

Re: [R] write.table and append

2013-02-08 Thread Brian Smith
Thanks Louis! That seems to work! On Fri, Feb 8, 2013 at 10:06 AM, Louis Aslett wrote: > I believe your problem stems from using ifelse() actually ... it > requires the statements which it runs to return a value with the same > shape as the test, which write.table() isn't doing. > > Just change i

Re: [R] write.table and append

2013-02-08 Thread Louis Aslett
I believe your problem stems from using ifelse() actually ... it requires the statements which it runs to return a value with the same shape as the test, which write.table() isn't doing. Just change it to a regular if with an else and you'll be fine: for(i in 1:2){ mat <- data.frame(sample(1:30

[R] write.table and append

2013-02-08 Thread Brian Smith
Hi, I am trying to append tables on file with this sample code: for(i in 1:2){ mat <- data.frame(sample(1:30,9),3,3) colnames(mat) <- letters[1:3] ifelse(i == 1,write.table(mat,paste('test.txt',sep=''),row.names=F), write.table(mat,paste('test.txt',sep

Re: [R] write.table: strange output has been produced

2012-09-19 Thread Igor
Thank you David - you put me into right direction. Back to normal, problem sorted. I've missed a single quote in 'annot' data when I imported it from file using read.table function with the default 'quote' argument. quote="\"" did the trick. Many thanks -Igor On Wed, 2012-09-19 at 14:55 -0700,

Re: [R] write.table: strange output has been produced

2012-09-19 Thread David Winsemius
On Sep 19, 2012, at 12:20 PM, Igor Chernukhin wrote: > Hi David - > Thank you for your reply. You are probably right. The last 'normal' line > doesn't have a double quote closed. There is the complete line below: > > -8< > "4657","1599

Re: [R] write.table: strange output has been produced

2012-09-19 Thread Igor Chernukhin
Hi Jim - Thank you for your reply. -8< > str(annot) 'data.frame': 6895 obs. of 4 variables: $ id : int 231803 231804 231805 231810 231811 231816 231818 177697 223131 231823 ... $ kogdefline : Factor w/ 1898 levels "17

Re: [R] write.table: strange output has been produced

2012-09-19 Thread Igor Chernukhin
Hi David - Thank you for your reply. You are probably right. The last 'normal' line doesn't have a double quote closed. There is the complete line below: -8< "4657","159998",133.10761487064,185.450704462326,80.7645252789532,0.43550400907

Re: [R] write.table: strange output has been produced

2012-09-19 Thread jim holtman
It would also be helpful if you could provide the output of 'str' for all the objects that you are using. e.g., str(statdata)str(extra) Also in creating your data.frame, use "stringsAsFactors = FALSE": extra = data.frame(kogdefline=rep(NA,n) , kogClass = rep(NA,n) , kogGroup = rep(

Re: [R] write.table: strange output has been produced

2012-09-19 Thread David Winsemius
On Sep 19, 2012, at 9:12 AM, Igor wrote: > Good afternoon all - > > While making a steady progress in learning R after Matlab I encountered > a problem which seems to require some extra help to move over. > Basically I want to merge a data from biological statistical dataset > with annotation da

[R] write.table: strange output has been produced

2012-09-19 Thread Igor
Good afternoon all - While making a steady progress in learning R after Matlab I encountered a problem which seems to require some extra help to move over. Basically I want to merge a data from biological statistical dataset with annotation data extracted from another dataset using an 'id' crossre

Re: [R] write.table and read.table commands

2012-08-27 Thread David Winsemius
On Aug 27, 2012, at 10:04 PM, R. Michael Weylandt > wrote: It's because read.table returns a data frame, not a matrix. You can coerce to a matrix with as.matrix() but you might loose information if your variables are of different classes. Michael On Aug 27, 2012, at 7:07 PM, Cheryl Johns

Re: [R] write.table and read.table commands

2012-08-27 Thread R. Michael Weylandt
It's because read.table returns a data frame, not a matrix. You can coerce to a matrix with as.matrix() but you might loose information if your variables are of different classes. Michael On Aug 27, 2012, at 7:07 PM, Cheryl Johnson wrote: > Greetings, > > When I try to use the write.table c

[R] write.table and read.table commands

2012-08-27 Thread Cheryl Johnson
Greetings, When I try to use the write.table command to save a matrix as a file and then open the file with read.table, if I try to take the mean of the entire matrix, instead each column of the matrix has its mean calculated. I have copied and pasted an example of my code below. When I try to mak

Re: [R] write.table extra column

2011-08-15 Thread Mike Hunter
Thanks! On Mon, Aug 15, 2011 at 12:55 AM, Jeff Newmiller wrote: > Yup. > > Read ?write.csv and note the row.names argument. > --- > Jeff Newmiller The . . Go Live... > DCN: Basics: ##.#. ##.#. Live Go... > Live: OO#..

Re: [R] write.table extra column

2011-08-15 Thread Jeff Newmiller
Yup. Read ?write.csv and note the row.names argument. --- Jeff Newmiller The . . Go Live... DCN: Basics: ##.#. ##.#. Live Go... Live: OO#.. Dead: OO#.. Playing Research Engineer (Solar/Batteries O.O#. #.O#. with /Softw

[R] write.table extra column

2011-08-15 Thread Mike Hunter
In the following data.frame there are 6 columns, but 7 are written to the CSV file. install.packages("pmlr") library(pmlr) data(enzymes) write.table(enzymes, sep=",", eol="\n",file="albert.csv") __ R-help@r-project.org mailing list https://stat.ethz.ch/

Re: [R] Write.table Question

2011-08-01 Thread Ivan Calandra
Hi Margaux, Check the row.names and col.names arguments of write.table. See ?write.table write.table (dat, file = "/path/to/my/data.txt", sep = " ", col.names=FALSE, row.names=FALSE) HTH, Ivan Le 8/1/2011 17:18, Margaux Keller a écrit : Hi, I'm trying to create an abbreviated data file fr

[R] Write.table Question

2011-08-01 Thread Margaux Keller
Hi, I'm trying to create an abbreviated data file from a larger version. I can use the subset command to create a value for this data: dat <-subset(raw.data, select=c(SNP, Pvalue)) > head (dat) SNP Pvalue 1 rs11 0.6516 2 rs12 0.3311 3 rs13 0.5615 but when I try to write.table using: w

Re: [R] write.table vs. read.table and the argument "fill"

2011-05-08 Thread Carl Witthoft
Well, it could be a list variable. foo<- 1:7 bar<-1:9 rab<-list(foo,bar) I suppose I could do something like oof<-rbind(foo,bar) write.table(oof) #ignore the warnings and then ignore or delete the redundant items in the output file. On 5/8/11 1:51 AM, Joshua Wiley wrote: Hi Carl, What wou

Re: [R] write.table vs. read.table and the argument "fill"

2011-05-08 Thread David Winsemius
On May 7, 2011, at 10:38 AM, Carl Witthoft wrote: Just wondering how come read.table lets you specify fill=TRUE for ragged arrays, but so far as I can tell, no equivalent for write.table? I imagine the answer is something along the lines of read.table creates a rectangular structur

Re: [R] write.table vs. read.table and the argument "fill"

2011-05-07 Thread Joshua Wiley
Hi Carl, What would the "equivalent" argument for write.table do? Or perhaps to rephrase my question what type of R object do you have in mind to write that is a "ragged array"? Josh On Sat, May 7, 2011 at 7:38 AM, Carl Witthoft wrote: > Just wondering how come read.table lets you specify fill

[R] write.table vs. read.table and the argument "fill"

2011-05-07 Thread Carl Witthoft
Just wondering how come read.table lets you specify fill=TRUE for ragged arrays, but so far as I can tell, no equivalent for write.table? Not a big deal, since I'm perfectly comfortable w/ write and scan and the other file I/O goodies. "A foolish inconsistency..." and all that. Carl _

Re: [R] write.table -- maintain decimal places

2011-01-26 Thread Jim Moon
Great. Thank you, Peter! -Original Message- From: Peter Ehlers [mailto:ehl...@ucalgary.ca] Sent: Tuesday, January 25, 2011 7:26 PM To: Jim Moon Cc: r-help@r-project.org Subject: Re: [R] write.table -- maintain decimal places On 2011-01-25 17:22, Jim Moon wrote: > Thank you for

Re: [R] write.table -- maintain decimal places

2011-01-26 Thread Jim Moon
I am using: "R version 2.11.1 (2010-05-31)" It is good to know that it works in 2.12.1 Jim -Original Message- From: Peter Ehlers [mailto:ehl...@ucalgary.ca] Sent: Tuesday, January 25, 2011 5:57 PM To: Jim Moon Cc: r-help@r-project.org Subject: Re: [R] write.table -- mainta

Re: [R] write.table -- maintain decimal places

2011-01-25 Thread Peter Ehlers
0.023 8.808e-01 -0.26 8.641e-02 -0.114 4.520e-01 -Original Message- From: Peter Ehlers [mailto:ehl...@ucalgary.ca] Sent: Tuesday, January 25, 2011 5:09 PM To: Jim Moon Cc: r-help@r-project.org Subject: Re: [R] write.table -- maintain decimal places On 2011-01-25 16:16, Jim M

Re: [R] write.table -- maintain decimal places

2011-01-25 Thread Peter Ehlers
ailto:ehl...@ucalgary.ca] Sent: Tuesday, January 25, 2011 5:09 PM To: Jim Moon Cc: r-help@r-project.org Subject: Re: [R] write.table -- maintain decimal places On 2011-01-25 16:16, Jim Moon wrote: Hello, All, How can I maintain the decimal places when using write.table()? Jim e.g. df: EFFE

Re: [R] write.table -- maintain decimal places

2011-01-25 Thread Jim Moon
0.45200 df.txt: EFFECT2PVALUE 0.023 8.808e-01 -0.26 8.641e-02 -0.114 4.520e-01 -Original Message- From: Peter Ehlers [mailto:ehl...@ucalgary.ca] Sent: Tuesday, January 25, 2011 5:09 PM To: Jim Moon Cc: r-help@r-project.org Subject: Re: [R] write.table -- maintain decimal pl

Re: [R] write.table -- maintain decimal places

2011-01-25 Thread Peter Ehlers
On 2011-01-25 16:16, Jim Moon wrote: Hello, All, How can I maintain the decimal places when using write.table()? Jim e.g. df: EFFECT2 PVALUE 1 0.0230.88080 2 -0.260 0.08641 3 -0.114 0.45200 write.table(df,file='df.txt',quote=F,sep='\t',row.names=F) write.table(format(df, drop0tr

Re: [R] write.table -- maintain decimal places

2011-01-25 Thread Sebastian P. Luque
On Tue, 25 Jan 2011 16:16:37 -0800, Jim Moon wrote: > Hello, All, How can I maintain the decimal places when using > write.table()? Have a look at ?format.data.frame -- Seb __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/

[R] write.table -- maintain decimal places

2011-01-25 Thread Jim Moon
Hello, All, How can I maintain the decimal places when using write.table()? Jim e.g. df: EFFECT2 PVALUE 1 0.0230.88080 2 -0.260 0.08641 3 -0.114 0.45200 write.table(df,file='df.txt',quote=F,sep='\t',row.names=F) df.txt: EFFECT2PVALUE 0.023 0.8808 -0.26 0.08641 -0.114

Re: [R] write.table equivalent for lists?

2011-01-10 Thread William Dunlap
p-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of Greg Snow > Sent: Monday, January 10, 2011 12:59 PM > To: Rainer M Krug; R-help > Subject: Re: [R] write.table equivalent for lists? > > How about dput and dget in the base package? > > --

Re: [R] write.table equivalent for lists?

2011-01-10 Thread Greg Snow
er M Krug > Sent: Monday, January 10, 2011 7:24 AM > To: R-help > Subject: [R] write.table equivalent for lists? > > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Hi > > I am writing simulations in R, and quite regularly, I have to save > lists > and obje

Re: [R] write.table equivalent for lists?

2011-01-10 Thread Peter Ehlers
On 2011-01-10 07:34, Rainer M Krug wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 01/10/2011 04:27 PM, Ivan Calandra wrote: I agree that the R-Core team has better things to do than that, but since it's already there, why not just add it to the base functions? Agree completely - and

Re: [R] write.table equivalent for lists?

2011-01-10 Thread Rainer M Krug
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 01/10/2011 04:27 PM, Ivan Calandra wrote: > I agree that the R-Core team has better things to do than that, but > since it's already there, why not just add it to the base functions? Agree completely - and R.utils is not such an obscure package whi

Re: [R] write.table equivalent for lists?

2011-01-10 Thread Ivan Calandra
I agree that the R-Core team has better things to do than that, but since it's already there, why not just add it to the base functions? Le 1/10/2011 16:19, Peter Ehlers a écrit : On 2011-01-10 06:45, Ivan Calandra wrote: Why isn't it in R base? Good question... I'm definitely not the one able

Re: [R] write.table equivalent for lists?

2011-01-10 Thread Peter Ehlers
On 2011-01-10 06:45, Ivan Calandra wrote: Why isn't it in R base? Good question... I'm definitely not the one able to answer to it! Maybe someone more involved in the development can? Ivan Well, I suspect that Rainer has been on this list long enough to know the answer: Because no has convince

Re: [R] write.table equivalent for lists?

2011-01-10 Thread Ivan Calandra
Why isn't it in R base? Good question... I'm definitely not the one able to answer to it! Maybe someone more involved in the development can? Ivan Le 1/10/2011 15:42, Rainer M Krug a écrit : -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 01/10/2011 03:35 PM, Ivan Calandra wrote: Hi, If I u

Re: [R] write.table equivalent for lists?

2011-01-10 Thread Rainer M Krug
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 01/10/2011 03:35 PM, Ivan Calandra wrote: > Hi, > > If I understood you correctly, you can use saveObject()/loadObject() > from package R.utils, like this: Correct - thanks - that is what I was looking for. But why is no such function in R base?

Re: [R] write.table equivalent for lists?

2011-01-10 Thread Ivan Calandra
Hi, If I understood you correctly, you can use saveObject()/loadObject() from package R.utils, like this: library(R.utils) saveObject(x, "x.Rbin") rm(x) y <- loadObject("x.Rbin") HTH, Ivan Le 1/10/2011 15:24, Rainer M Krug a écrit : -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi I am wr

[R] write.table equivalent for lists?

2011-01-10 Thread Rainer M Krug
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi I am writing simulations in R, and quite regularly, I have to save lists and objects to HDD and load it later again. So I am wondering: why is there no function to write lists (and S3, S4 objects) onto HDD WITHOUT keeping the name? What I mean is:

Re: [R] Write.table eol argument

2010-12-21 Thread William Dunlap
; A l a s 030 k a \n 3 ; 3 ; A 040 r i z o n a \n 047 Bill Dunlap Spotfire, TIBCO Software wdunlap tibco.com > -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Be

[R] Write.table eol argument

2010-12-21 Thread Jim Moon
Hello All, R 2.11.1 Windows XP, 32-bit Help says that default is eol='\n'. To me, that represents Linefeed (LF) >From Help: eol the character(s) to print at the end of each line (row). For example, eol="\r\n" will produce Windows' line endings on a Unix-alike OS, and eol="\r" will produce

Re: [R] "Write.table" problem

2010-06-15 Thread jim holtman
Do you have comment characters in your data (#)? Are there unbalanced quotes in your data? How may rows does it read in? If you look at the last line read, can you see a problem in your data? These are problems that you will have with your data and try: comment.char='', quotes='' to see what ha

[R] "Write.table" problem

2010-06-15 Thread Steven Kang
Hi all, I have imported csv file for processing and exported as txt file (using * "write.table"* with sep = "\t", row.names = FALSE options) However, when I import this txt file in R (*"read.delim"* with header = TRUE, sep = "\t" options) the dimension (i.e number of rows) is inconsistent with th

Re: [R] write.table column names shift

2009-09-04 Thread Stefan Grosse
On Fri, 4 Sep 2009 01:07:49 -0700 (PDT) dennis11 wrote: D> It added an index and shifted the column names by one, b is above a, D> and a is above the added index. Try the option row.names=FALSE in write.table then no index is written. Stefan __ R-hel

[R] write.table column names shift

2009-09-04 Thread dennis11
Hi everyone, I want to write some data to file, for example a = c(1,2,3,4,5) b = c(5,6,7,8,9) write.table(cbind(a,b), file = "R output.csv", sep = ",") The result is this: a b 1 1 5 2 2 6 3 3 7 4 4 8 5 5 9 It added an i

Re: [R] write.table

2009-02-20 Thread Wacek Kusnierczyk
Rolf Turner wrote: > > On 21/02/2009, at 12:54 AM, lauramorg...@bluewin.ch wrote: > >> Thank you for your advice, but I didn't manage to make it work... >> I tried >> >> carichi.annui <- >> data.frame(anno,loadPTG,loadPO4,loadNT,loadNH4,loadNO3,loadBOD5,loadSiO2) >> >> >> And I got this error messa

Re: [R] write.table

2009-02-20 Thread Rolf Turner
On 21/02/2009, at 12:54 AM, lauramorg...@bluewin.ch wrote: Thank you for your advice, but I didn't manage to make it work... I tried carichi.annui <- data.frame (anno,loadPTG,loadPO4,loadNT,loadNH4,loadNO3,loadBOD5,loadSiO2) And I got this error message: Error in data.frame(anno, loadPTG,

Re: [R] write.table

2009-02-20 Thread lauramorg...@bluewin.ch
Thank you!!! unlist() worked perfectly!!! Have a nice weekend Laura Messaggio originale Da: petr.pi...@precheza.cz Data: 20.02.2009 14.58 A: Copia: Oggetto: Re: [R] write.table Hi r-help-boun...@r-project.org napsal dne 20.02.2009 12:54:41: > Thank you for your advice, but I did

Re: [R] write.table

2009-02-20 Thread Petr PIKAL
vector() could turn a list of numbers into a > vector... was I wrong? > > Messaggio originale > Da: rip...@stats.ox.ac.uk > Data: 20.02.2009 12.40 > A: "lauramorg...@bluewin.ch" > Copia: > Oggetto: Re: [R] write.table > > On Fri, 20 Feb 2009, lau

Re: [R] write.table

2009-02-20 Thread Huang, Guo-Hao
May you put your code and data in the internet? It will be easy for others to find your real problem. - Original Message - From: To: Sent: Friday, February 20, 2009 7:54 PM Subject: Re: [R] write.table Thank you for your advice, but I didn't manage to make it work... I

Re: [R] write.table

2009-02-20 Thread lauramorg...@bluewin.ch
ist" I thought that the function as.vector() could turn a list of numbers into a vector... was I wrong? Messaggio originale Da: rip...@stats.ox.ac.uk Data: 20.02.2009 12.40 A: "lauramorg...@bluewin.ch" Copia: Oggetto: Re: [R] write.table On Fri, 20 Feb 2009, lauramorg.

Re: [R] write.table

2009-02-20 Thread Prof Brian Ripley
On Fri, 20 Feb 2009, lauramorg...@bluewin.ch wrote: Sorry, I'm using R 2.8.1 on Microsoft Windows XP professional 2002 Service Pack 2. The error I get is Error in write.table(x, file, nrow(x), p, rnames, sep, eol, na, dec, as.integer(quote), : 'list' type not implemented in 'EncodeElement

Re: [R] write.table

2009-02-20 Thread lauramorg...@bluewin.ch
Sorry, I'm using R 2.8.1 on Microsoft Windows XP professional 2002 Service Pack 2. The error I get is Error in write.table(x, file, nrow(x), p, rnames, sep, eol, > na, dec, as.integer(quote), : 'list' type not implemented in 'EncodeElement' The problem is that I can' t manage to save the

Re: [R] write.table

2009-02-20 Thread Simon Pickett
things) Hope this helps? S - Original Message - From: To: Sent: Friday, February 20, 2009 7:56 AM Subject: [R] write.table Hello, I tried to turn lists into vectors and then bind them together in order to create a dataframe but if, after this, I try to use the function write.t

Re: [R] write.table

2009-02-20 Thread Daniel Nordlund
> -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of > lauramorg...@bluewin.ch > Sent: Thursday, February 19, 2009 11:57 PM > To: r-help@r-project.org > Subject: [R] write.table > > Hello, > I tried

[R] write.table

2009-02-19 Thread lauramorg...@bluewin.ch
Hello, I tried to turn lists into vectors and then bind them together in order to create a dataframe but if, after this, I try to use the function write.table I get the following error message: Error in write.table(x, file, nrow(x), p, rnames, sep, eol, na, dec, as.integer(quote), : 'list'

Re: [R] write.table a df with specific column order

2008-06-26 Thread Don MacQueen
Minor correction -- omitted comma. Should be: write.table(t[ , c("a", "b", "c")], row.names=FALSE) Also, using the name "t" should be avoided, because "t" is a built-in function: t() -Don At 8:02 AM -0300 6/26/08, Henrique Dallazuanna wrote: Content-Type: text/plain Content-Disposition:

Re: [R] write.table a df with specific column order

2008-06-26 Thread Henrique Dallazuanna
Try: write.table(t[c("a", "b", "c")], row.names=F) On Thu, Jun 26, 2008 at 6:28 AM, juli pausas <[EMAIL PROTECTED]> wrote: > Hi > I'd like to write.table a dataframe, but with an specific order of > columns. Is there a direct way to do it? or I have to generate a new > dataframe as follows: > >

[R] write.table a df with specific column order

2008-06-26 Thread juli pausas
Hi I'd like to write.table a dataframe, but with an specific order of columns. Is there a direct way to do it? or I have to generate a new dataframe as follows: t <- data.frame(c=1:10, b=11:20, a=letters[1:10]) t2 <- data.frame(a=t$a, b=t$b, c=t$c) write.table(t2, row.names=F) Thanks for any com

Re: [R] write.table() error

2008-06-05 Thread Daniel Folkinshteyn
looks like you don't have permission to write a file to C:\ try writing to some other directory where you have write access (e.g., your user's home dir, or your "my documents", or something like that). on 06/05/2008 11:57 PM Megh Dal said the following: Hi, I got following error in write.tab

Re: [R] write.table() error

2008-06-05 Thread Charilaos Skiadas
I just managed to write things just fine, and then I recalled that I had a similar problem when teaching our students SPSS (Yes, I know, don't ask...), but the problem was effectively this: If a given file was open in Excel, then that file was locked and no other program could use it until

[R] write.table() error

2008-06-05 Thread Megh Dal
Hi, I got following error in write.table() : > write.table(dataa, file="c:/data1.csv", row.names=F, col.names=T, sep=",") Error in file(file, ifelse(append, "a", "w")) : cannot open the connection In addition: Warning message: In file(file, ifelse(append, "a", "w")) : cannot open file 'c:/d