Ah, that works! Thank you!
From: PIKAL Petr
Sent: Tuesday, May 2, 2017 7:56:33 AM
To: C W; r-help
Subject: RE: [R] How create columns for squared values from previous columns?
Hi
you can use data.frame
data.frame(dat, dat[,1:3]^2)
and you can set names afterwar
Thanks Rolf.
I was just a bit frustrated that R wouldn't generate dummy variable names on
the fly.
Also, another question, if I want to put column 5 at column 3,
dat[, 3:5] <- dat[, c(5,3,4)]
It does not work, why?
From: Rolf Turner
Sent: Friday, April 28, 201
I was using OS X native R editor. I would imagine that editor is as simple and
native as it gets. But, if it's truly native, why would Gmail think of my code
chunk so differently.
I'm just throwing it out there! I can always remove format in Gmail after
pasting as a precaution. :)
On Fri,
3 matches
Mail list logo