Skip to content
Prev 317711 / 398506 Next

Extracting Numeric Columns from Data Fram

Hello,

You should provide us with a data example, like the posting guide says.
Anyway, see the following example.

# make up some data
dat <- data.frame(X = 1:4, Y = rnorm(4), Z = letters[1:4])
str(dat)
# this returns the numeric/integer columns
dat[sapply(dat, is.numeric)]


Hope this helps,

Rui Barradas

Em 16-02-2013 18:15, Barry DeCicco escreveu: