how to summarise only numerical columns in R : <p>I want to have summary of only numerical columns of R dataframe. I am doing following</p>

<pre><code>numeric_var &lt;- names(df)[which(sapply(df, is.numeric))]

summary(df[,.SD, .SDcols = numeric_var])
</code></pre>

<p>But, I get following error</p>

<pre><code>Error in `[.data.frame`(df, , .SD, .SDcols = numeric_var) : 
unused argument (.SDcols = numeric_var)
</code></pre>

<p>How can I do it in R?</p>
