s-news
[Top] [All Lists]

[S] write.table() and factors

To: s-news@wubios.wustl.edu
Subject: [S] write.table() and factors
From: Nicole DePriest Demers <ntd@stat.ohio-state.edu>
Date: Mon, 28 Jun 1999 09:14:22 -0400 (EDT)
Sender: owner-s-news@wubios.wustl.edu
Hello Splus Users,

My question is in regard to the write.table() function.  I have a
dataframe with both numbers and character strings.  I am attempting to
write some columns to an output file.  One of the columns I am trying
to output consists of character strings.  However, I get the following
error:

> write.table(round(bamowt.sqrt.df[,c(1,2,4:10,13)],6), file="tmp", sep="  ")
Error in Math.data.frame(bamowt.sqrt.df[, c(1, 2, ..: Non-numeric (non-complex)
        variable: grouptyp
Dumped

I suspect the problem has to do with the fact that I used read.table()
to input the data originally so the character strings are now
considered factors.  No problems occur when I omit the "grouptyp"
column.  

Any suggestions or workarounds?

Please e-mail me and I will summarize to the group.

Thanks in advance,

Nicole Demers


______________________________________________________________________________
Nicole Demers
Statistics Department
The Ohio State University
1958 Neil Ave., #404
Columbus, OH 43210, USA
(614) 292-6038
ntd@stat.ohio-state.edu

-----------------------------------------------------------------------
This message was distributed by s-news@wubios.wustl.edu.  To unsubscribe
send e-mail to s-news-request@wubios.wustl.edu with the BODY of the
message:  unsubscribe s-news

<Prev in Thread] Current Thread [Next in Thread>