How to calculate mean vector of data set in R?
<p>I'm very new to R, so please bear with me. </p>

<p>Given test data in a .txt file...</p>

<pre>
Num   height   weight   class  
1     72.1     147.5    1  
2     75.2     125.4    1
3     60.3     102.3    2
4     62.4     98.2     2
5     50.5     74.1     3
</pre>

<p>I read the file into R by:</p>

<pre><code>testdata &lt;- read.table("testdata.txt", header = TRUE)
</code></pre>

<p>which creates the data with 15 obs. of 4 variables. I can assign each column to an object, like so:</p>

<pre><code>numCol &lt;- testdata$Num
heightCol &lt;- testdata$height
weightCol &lt;- testdata$weight
classCol &lt;- testdata$class
</code></pre>

<p>Then, for instance, heightCol gives me</p>

<pre><code>heightCol
&gt; 72.1 75.2 60.3 62.4 50.5
</code></pre>

<p>What I need to do is take each class and find the mean vectors, standard deviation, scatter diagrams, and parallel coordinates.</p>

<p>If someone could explain to me how to find, say, just the mean vectors I'm sure I could figure out the rest. </p>