[R] Add row to data frame

Martin Maechler maechler at stat.math.ethz.ch
Mon Dec 8 12:09:15 CET 2003


>>>>> "Pascal" == Pascal A Niklaus <Pascal.Niklaus at unibas.ch>
>>>>>     on Mon, 08 Dec 2003 11:47:02 +0100 writes:

    Pascal> Hi all, is there an easy way to build up a data
    Pascal> frame by sequentially adding individual rows? 

yes, pretty easy, but usually not recommended because quite
inefficient.

rbind() does work with data frames in the cases we know.
Have a look at help(rbind.data.frame)


    Pascal> The data frame consists of numeric and character
    Pascal> columns. I thought of rbind, but I ended up with
    Pascal> numeric values for the character columns.

We'd need to see [i.e give a reproducible example!]
how you "ended up with numeric values for the  character
columns" -- which I guess were *factor* instead of character ?

Regards to Basel,
Martin Maechler <maechler at stat.math.ethz.ch>	http://stat.ethz.ch/~maechler/
Seminar fuer Statistik, ETH-Zentrum  LEO C16	Leonhardstr. 27
ETH (Federal Inst. Technology)	8092 Zurich	SWITZERLAND
phone: x-41-1-632-3408		fax: ...-1228			<><




More information about the R-help mailing list