Skip to content

How to show classes of all columns of a data frame?

2 messages · Terry Mu, Marc Schwartz (via MN)

#
On Tue, 2006-08-15 at 13:10 -0400, T Mu wrote:
Depending upon the output format you desire:
$Sepal.Length
[1] "numeric"

$Sepal.Width
[1] "numeric"

$Petal.Length
[1] "numeric"

$Petal.Width
[1] "numeric"

$Species
[1] "factor"


or
Sepal.Length  Sepal.Width Petal.Length  Petal.Width      Species
   "numeric"    "numeric"    "numeric"    "numeric"     "factor"


See ?lapply and ?sapply


HTH,

Marc Schwartz