title: R: RScript Vector as argument
body: <p>i am using the preinstalled package RScript in R. </p>
  
  <p>I want to call the following R-Script with the name 'test.R' from the command prompt:</p>
  
  <pre><code>a &lt;- c("a", "b", "c")
  a
  
  args &lt;- commandArgs(TRUE)
  b &lt;- as.vector(args[1])
  b
  </code></pre>
  
  <p>I use the following command:</p>
  
  <pre><code>RScript test.R c("d","e","f")
  </code></pre>
  
  <p>This creates following output:</p>
  
  <pre><code>[1] "a" "b" "c"
  [1] "c(d,e,f)"
  </code></pre>
  
  <p>As you see, the first (and only) argument is interpreted as a String, then converted to a 1-dimensional vector. How can the argument be interpreted as a vector? </p>
  
  <p>Sidenote: Of course the items of the vector could be separated into several arguments, but in my final project, there will be more than one vector-argument. And to implement something like this is my last resort:</p>
  
  <pre><code>RScript test.R "d" "e" "f" END_OF_VECTOR_1 "g" "h" "i" END_OF_VECTOR_2 "j" "k" "l"
  </code></pre>