How to standardize a data frame which contains both numeric and factor variables
<p>My data frame, my.data, contains both numeric and factor variables. I want to standardise just the numeric variables in this data frame. </p>

<pre><code>&gt; mydata2=data.frame(scale(my.data, center=T, scale=T))
Error in colMeans(x, na.rm = TRUE) : 'x' must be numeric
</code></pre>

<p>Could the standardising work by doing this? I want to standardise the columns 8,9,10,11 and 12 but I think I have the wrong code.</p>

<pre><code>mydata=data.frame(scale(flowdis3[,c(8,9,10,11,12)], center=T, scale=T,))
</code></pre>

<p>Thanks in advance</p>