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

Iteratively create objects (See related posts)

// Iteratively create objects from a list of names.
// Especially useful for creating consistent model objects for a list of data sources.
// Wrapping the assign statement in a try block is often advisable.

for(item in itemList){
	assign(paste(item, "object", sep="."),  function(get(paste(item, "data", sep=".")), options)
}

You need to create an account or log in to post comments to this site.


Click here to browse all 4881 code snippets

Related Posts