On Nov 25, 2011, at 2:10 PM, Ian Strang wrote:
This look really interesting but I don't understand what is happening.
Please can someone explain the last line and what the bit in [] is
doing.
Ian
You just stick the new line on the bottom and return the rows in the
order specified in the
This look really interesting but I don't understand what is happening.
Please can someone explain the last line and what the bit in [] is doing.
Ian
df = data.frame( A=c('a','b','c'), B=c(1,2,3), C=c(10,20,30),
stringsAsFactors=FALSE)
newrow = c('X', 100, 200)
rbind(df,newrow)[c(1,4,2,3),]
___
On Thu, 24 Nov 2011, Jeff Newmiller wrote:
AFAIK all solutions to the "grow object size" problem in R involve
creation of a new object to "change" an old one. There is
considerable sophistication under the hood that allows a minimum of
intermediate objects to be created if you are careful, bu
AFAIK all solutions to the "grow object size" problem in R involve creation of
a new object to "change" an old one. There is considerable sophistication
under the hood that allows a minimum of intermediate objects to be created if
you are careful, but actually changing the size of an object in
Hi.
May be this:
df = data.frame( A=c('a','b','c'), B=c(1,2,3), C=c(10,20,30),
stringsAsFactors=FALSE)
newrow = c('X', 100, 200)
rbind(df,newrow)[c(1,4,2,3),]
Andrija
On Thu, Nov 24, 2011 at. 6:05 PM, Sammy Zee wrote:
> Is there easy way (without copying the existing rows to a temporary
> l
Is there easy way (without copying the existing rows to a temporary
location and copying back) to add a new row to a specific index location in
an existing data frame?
Example
df = data.frame( A= c('a','b','c'), B=c(1,2,3), C=(10,20,30))
newrow = c('X', 100, 200)
I want to add the newrow as the
6 matches
Mail list logo