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

Create a vector, append values. (See related posts)

To create a mathematical vector, you can just initialize a column of numbers with c(). As long as all of your input is of the same type, you don't hit any snags. Note the is.vector() function will say this is a vector:

> v <- c(1, 2, 3) 
> is.vector(v) 

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


Click here to browse all 5147 code snippets

Related Posts