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:
Hello,

I've got a data frame with a mix of numeric, integer and factor columns.
I'd like to pull out (or just operate only on) the numeric/integer columns.
Every thing I've found in searches is about how to subset by rows,
or how to operate assuming you have the column names.  I'd like to pull
by type.

Thanks!

Barry

        [[alternative HTML version deleted]]



______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to