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) 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 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]]
> 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 charactersThis 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. Andy> 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 > >
As you know, R is not S-Plus, though they for the most part share a common syntax (S) and a lot of (nearly) identical functions with (nearly) identical behavior. Nevertheless, there's lots of stuff in S-Plus that's not in R and vice-versa. So you shouldn't expect to find all S-Plus functions in R. Almost certainly, the functionality will be in R to write them yourself (and vice-versa).Less certainly, there may be a function by a different name that does the same thing. For this you should search Help files (?help.search) and the online search facilities at CRAN first before posting to this list. Cheers, Bert -- Bert Gunter Non-Clinical Biostatistics Genentech MS: 240B Phone: 650-467-7374 "The business of the statistician is to catalyze the scientific learning process." -- George E.P. Box
Hoi Tiago, --On dinsdag 3 augustus 2004 18:50 +0100 Tiago R Magalhaes <tiago17 at socrates.Berkeley.EDU> wrote:> 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 >Recently we discussed, on this list, that several online communities have dedicated discussion groups for R. One of them is Orkut.com. The name of the other one slips my mind, but if you search the archives for my name and orkut, then you'll probably find those emails quickly. regards, Paul -- Paul Lemmens NICI, University of Nijmegen ASCII Ribbon Campaign /"\ Montessorilaan 3 (B.01.05) Against HTML Mail \ / NL-6525 HR Nijmegen X The Netherlands / \ Phonenumber +31-24-3612648 Fax +31-24-3616066