Skip to content
Back to formatted view

Raw Message

Message-ID: <Pine.A41.4.44.0211111727140.112706-100000@homer05.u.washington.edu>
Date: 2002-11-12T01:27:52Z
From: Thomas Lumley
Subject: numerics only
In-Reply-To: <EF5DF4C5DB7BD311816D00007789395B0AA952A5@rosnt50.ets.org>

On Mon, 11 Nov 2002, Blew, Ted wrote:

> is there a way to identify the *numeric* data elements (columns) in a
> data.frame that contains both numeric and character data elements?  thanks
> in advance, ted.

   sapply(dataframe, is.numeric)
or
   which(sapply(data.frame, is.numeric))

	-thomas

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._