Never been to DZone Snippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

About this user

Matthew Routley http://matt.routleynet.org

« Newer Snippets
Older Snippets »
Showing 1-1 of 1 total  RSS 

Create data frame from variable number of vectors

// Create a data frame from a varied number of vectors
// Taken from http://article.gmane.org/gmane.comp.lang.r.general/56501/match=create+data+frame

N1 <-c(1,2,3,4)
N2 <-c(1,2,3,4)
N3 <-c(1,2,3,4)
abc <-c(1,2,3)
lab <- paste("N", seq(along=abc), sep="")
D <- data.frame(lapply(lab, get))
names(D) <- lab
« Newer Snippets
Older Snippets »
Showing 1-1 of 1 total  RSS