[R] basic questions: any place for them

Liaw, Andy andy_liaw at merck.com
Tue Aug 3 20:05:24 CEST 2004

> From: Tiago R Magalhaes
> Hi
> 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 
> people
> I've used Splus and now I'm using R and there's some functions that I 
> can't simply find
> one:
> sort.col
> 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:
> convert.col.type
> 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
> thanks
> 	[[alternative HTML version deleted]]
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! 
> http://www.R-project.org/posting-guide.html

More information about the R-help mailing list