Initialize an Empty Vector in R

If you want to declare an empty vector in R, you can do the following:

vec <- vector()

Then you can add element to this vector:

vec <- c(vec, 1:10)

The value of vec now is:

 1  2  3  4  5  6  7  8  9 10
Category >> R  
If you want someone to read your code, please put the code inside <pre><code> and </code></pre> tags. For example:
<pre><code> 
String foo = "bar";
</code></pre>