No need for computer-intensive loops. Try the following:
a <- data.frame(x = c(1,2,3,4), y = c(1,2,1,2))
xx=data.frame(x.1=a[,1],x.2=2*a[,1])
yy=data.frame(y.1=a[,2],y.2=2*a[,2])
Cheers
Francisco
From: "Apoian, Zack" <[EMAIL PROTECTED]>
To:
Subject: [R] data frame output in
I know this is very basic--I'm wondering if there is a way to write data
frames as outputs from a loop.
In other words, take this simple example:
> a <- data.frame(x = c(1,2,3,4), y = c(1,2,1,2))
Given a, how would you write a loop that creates two data frames, x and y,
where the first colum
On Fri, 19 Mar 2004, Randy Zelick wrote:
> I got three responses for help on the leading zero problem. Thank you.
Well, it seems that you didn't tell us what the actual problem was: please
consult the posting guide and its references and learn to ask the right
question.
> Alas I still don't have
Hello again,
I got three responses for help on the leading zero problem. Thank you.
Alas I still don't have it working. Here are more specifics:
I read in a data file like this:
participants<-read.table("C:/Work/blah-blah")
The data file consists of the fields last name, first name, social
secu
> "Randy" == Randy Zelick <[EMAIL PROTECTED]>
> on Thu, 18 Mar 2004 21:00:08 -0800 (PST) writes:
Randy> Hello list,
Randy> Is there a way to *not* supress leading zeros when printing (to the
Randy> console window or to a file) a dataframe?
Yes, e.g. use
formatC(..., for
On Thu, 18 Mar 2004, Randy Zelick wrote:
> Is there a way to *not* supress leading zeros when printing (to the
> console window or to a file) a dataframe?
If you mean via print() or autoprinting, no.
I am not sure why you would want to do this, but it seems that using
format() and then gsub shoul
Hello list,
Is there a way to *not* supress leading zeros when printing (to the
console window or to a file) a dataframe?
Thanks,
=Randy=
R. Zelick email: [EMAIL PROTECTED]
Department of Biology voice: 503-725-3086
Portland State University