Skip to content
Prev 155489 / 398503 Next

exporting tapply objects to csv-files

On Tue, Sep 9, 2008 at 3:48 AM, Kunzler, Andreas <a.kunzler at bzaek.de> wrote:
An alternative would be to use reshape (http://had.co.nz/reshape):

mydf <- data.frame( a = sample(7, 100, rep = T), b =
sample(letters[1:15], 100, rep = T))

library(reshape)
mydf$value <- 1
cast(mydf, b ~ a, sum, margins="row.major", fill = 0)

Regards,

Hadley