[R] basic questions: any place for them
andy_liaw at merck.com
Tue Aug 3 20:05:24 CEST 2004
> From: Tiago R Magalhaes
> I have two basic questions, and here they go, but I was wondering as
> well where can I ask these basic questions without bothering you
> I've used Splus and now I'm using R and there's some functions that I
> can't simply find
> that allows data.frames to be sort by a given col
> (I saw the funtion sort but that's for vectors. and I can't believe I
> can't find the function for data.frames)
This is sort of an FAQ. The short answer is to use order(). I've posted a
suggestion for a sort() method for data.frame the last time this was asked.
You can find it in the list archive.
> the other function I wanted to know:
> that converts a given column of a data frame from let's say integer
> to characters
This can usually be done by something like:
dat$thiscol <- as.blah(dat$thiscol)
[replace `as.blah' appropriately; e.g., as.character(), etc.] Just be
careful with factors.
> Once again I'm sorry for these basic questions and since predictably
> I'll have more of those if there's a basic-questions-list I would
> love to know more about it
> [[alternative HTML version deleted]]
> R-help at stat.math.ethz.ch mailing list
> PLEASE do read the posting guide!
More information about the R-help