[R] Order labels in qplot() - ggplot2 {help}

2010-06-10 Thread Kim Jung Hwa
Hello, I want to arrage the label according to my preference eg.. (va, vp, a, b, c) but don't know how to supress default ordering. Any suggestions? Please try the code below: n <- c("va", "vp", "a", "b", "c") p <- c(2, 2,1, 3,5) pm<- c(3,4,2,5,4) pn <- c(1,1,1,2,3) x<-data.frame(cbind(n,p,pm,pn

Re: [R] bug? in stats::cor for use=complete.obs with NAs

2010-06-10 Thread Peter Ehlers
I don't think that this would be considered a bug. The reason for the discrepancy between use="complete.obs" and use="pairwise.complete.obs" for the case of the Spearman correlation of two vectors x, y is this: "pairwise" does complete.cases(x,y) and then ranks; this is also what's done in cor.te

[R] use of aggregate

2010-06-10 Thread Philip
Dear list, Is it possible to replace the median in the following code so as to calculate 5 and 95% tiles? with( raunheim, aggregate(no, by = list(wd,hr), FUN = "median", na.rm=TRUE) ) Regards, Philip Sinclair __ R-help@r-project.org mailing list ht

Re: [R] Order labels in qplot() - ggplot2 {help}

2010-06-10 Thread William Dunlap
> -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of baptiste auguie > Sent: Thursday, June 10, 2010 11:50 AM > To: Kim Jung Hwa > Cc: r-help@r-project.org; ggplot2 > Subject: Re: [R] Order labels in qplot() - ggplot2 {help} > > Hi

Re: [R] Date conversion

2010-06-10 Thread Joshua Wiley
Hello Felipe, Is this what you want? format(as.Date("3/10/10", format="%m/%d/%y"), "%B %d, %Y") Josh On Thu, Jun 10, 2010 at 8:29 AM, Felipe Carrillo wrote: > Hi: > Can't find a way to convert from shortDate to LongDate format. I got: > 3/10/10 that I want to convert to March 10, 2010. I am us

Re: [R] calibration and validation for svycoxph

2010-06-10 Thread R user
Hi Dr. Lumley, Sorry about the succession of the 2 messages. It wasn't intended. This is my first post to the forum and I first signed up to Nabble and submitted the post and later got the message from Nabble that the post has not been accepted by the R forum and that I need separate subscription

Re: [R] R: selecting and excluding files through a pattern

2010-06-10 Thread Phil Spector
Here's one possibility: allfiles = list.files() csvfiles = list.files(pattern='csv') allfiles[!allfiles %in% csvfiles] - Phil Spector Statistical Computing Facility Departmen

Re: [R] Can RMySQL be used for a paramterized query?

2010-06-10 Thread Ted Byers
Thanks, Actually, thanks to the info Henrique sent, I have made decent progress. In actuality, I could have just submitted a SELECT * on the second table, which would give me everything, just like Henrique's suggestion, and yours, would give me. The problem is that that table is HUGE (I don't wa

Re: [R] Order labels in qplot() - ggplot2 {help}

2010-06-10 Thread baptiste auguie
Hi, You could reorder the factor levels before plotting, x$n = factor(x$n, levels=c("va","vp", letters[1:3])) last_plot() %+% x or you could avoid using factors in the first place, x <- data.frame(cbind(n,p,pm,pn), stringsAsFactors=FALSE) last_plot() %+% x HTH, baptiste On Thu, Jun 10, 20

Re: [R] Row binding

2010-06-10 Thread Liviu Andronic
On Thu, Jun 10, 2010 at 10:37 AM, Patrick Burns wrote: > See 'The R Inferno' Circle 2 for why > this takes so long, and what to do > about it. > Also check this Rnews issue [1], page 46, on how to make loops faster. Liviu [1] http://www.r-project.org/doc/Rnews/Rnews_2008-1.pdf __

Re: [R] use of aggregate

2010-06-10 Thread Erik Iverson
Philip wrote: Dear list, Is it possible to replace the median in the following code so as to calculate 5 and 95% tiles? with( raunheim, aggregate(no, by = list(wd,hr), FUN = "median", na.rm=TRUE) ) Please give reproducible examples that we can run by cutting and pasting! You should just g

Re: [R] Package not on CRAN mirrow - what now?

2010-06-10 Thread Cedrick W. Johnson
Just as a side note, perhaps this will help someone else who comes across this topic of packages no longer being on CRAN and built before 2.11.0 in that case they can't install the package... I use package 'sma' which was last maintained sometime in the mid 2000's and obviously it's not on CRA

[R] R: selecting and excluding files through a pattern

2010-06-10 Thread mauede
Actually this pattern will select the files whose name contains "csv". Whereas I'd like to exscude them. Maura -Messaggio originale- Da: Jorge Ivan Velez [mailto:jorgeivanve...@gmail.com] Inviato: gio 10/06/2010 17.30 A: mau...@alice.it Cc: r-h...@stat.math.ethz.ch Oggetto: Re: [R] select

Re: [R] Can RMySQL be used for a paramterized query?

2010-06-10 Thread Paul Gilbert
Ted I'm not sure I fully understand the question, but you may want to consider creating a temporary table with a join, which you can do with a query from your R session, and then query that table to bring the data into R. Roughly, the logic is to leave the data in the db if you are not doing an

[R] setting the current working directory to the location of the source file

2010-06-10 Thread Marcin Gomulka
AFAIK a script run through source() does not have any legit way to learn about it's own location. I need this to make sure that the script will find its datafiles after I move the whole directory. (The datafiles are in the same directory.) Here is a hack I invented to work around it: print(getwd

Re: [R] R: selecting and excluding files through a pattern

2010-06-10 Thread Henrique Dallazuanna
patt <- ".*Prostate.*cvs.*" dir(pattern = patt) On Thu, Jun 10, 2010 at 7:07 PM, wrote: > Actually this pattern will select the files whose name contains "csv". > Whereas I'd like to exscude them. > Maura > > -Messaggio originale- > Da: Jorge Ivan Velez [mailto:jorgeivanve...@gmail.com]

Re: [R] Retrieving the 2 row of "dist" computations

2010-06-10 Thread Jeff08
Edit: There is something funky about the code. It definitely returns the right column of the "distance" data, but returns an incorrect row. Code: NCols=250 NRows=829 myMat<-matrix(runif(NCols*NRows), ncol=NCols) d<-dist(myMat) e<-sort.list(d) e<-e[1:5] ##Retrieve minimum 5 distances k <-

Re: [R] setting the current working directory to the location of the source file

2010-06-10 Thread Mohan L
On Fri, Jun 11, 2010 at 6:03 AM, Marcin Gomulka wrote: > AFAIK a script run through source() does not have any legit way to learn > about it's own location. > > I need this to make sure that the script will find its datafiles after I > move the whole directory. (The datafiles are in the same dire

Re: [R] Retrieving the 2 row of "dist" computations

2010-06-10 Thread Jeff08
Hey Jorge, Don't know if you received this but, essentially I found something weird with the outputs. Edit: There is something funky about the code. It definitely returns the right column of the "distance" data, but returns an incorrect row. Code: NCols=250 NRows=829 myMat<-matrix(runif(NCols

Re: [R] Correlation Matrix

2010-06-10 Thread sayan dasgupta
Hi , you can try using cov2cor(vcov(lm(calorie~height))) to get the correlation matrix of estimated coefficients boltonboy999 wrote: > > Hi everyone, > > This is pretty urgent so if anyone can help that would be great. > > I have a table of information. The categories are weight, height

[R] Misplacement of Greek letter

2010-06-10 Thread beloitstudent
Hello. I am trying to get my axis label to read as follows (The symbol) Delta AUC blah blah... then below it...(some other text) The problem is the Delta symbol shows up beside the "(some other text)" rather than the "AUC". Does any one know how I can get the Delta to remain beside AUC? H

Re: [R] setting the current working directory to the location of the source file

2010-06-10 Thread Charles C. Berry
On Fri, 11 Jun 2010, Marcin Gomulka wrote: AFAIK a script run through source() does not have any legit way to learn about it's own location. You mean like 'test.R' being able to figure out that that is what it is called when it is invoked from source()? cat("print(eval(sys.calls()[[1]][[

Re: [R] 45 degree tick marks

2010-06-10 Thread Kathleen Schurr
Thanks for the advice! I'm not sure I fully understand how to get the text() function to rotate the axis, but I'll fiddle and see if I can't get it to work. On Thu, Jun 10, 2010 at 7:50 AM, Marc Schwartz wrote: > On Jun 10, 2010, at 7:18 AM, Jim Lemon wrote: > > > On 06/10/2010 01:44 PM, beloit

Re: [R] Issues with Bar Graph

2010-06-10 Thread beloitstudent
Thanks Jannis! I feel so dumb! I didn't specify the par(mar) before I wrote the code...thanks for checking me :) beloitstudent On Thu, Jun 10, 2010 at 4:28 AM, jannis-2 [via R] < ml-node+2250158-1003270618-278...@n4.nabble.com > wrote: > > > I am having a few problems with this. 1) My y > >

Re: [R] points marking

2010-06-10 Thread khush ........
Dear Gregory , Thnaks for your reply and help. I am explaining you my problems again, below is my script for the same . Dom <-c (195,568,559) fkbp <- barplot (Dom, col="black", xlab="", border = NA, space = 7, xlim=c(0,650), ylim =c(0, 87), las = 2, horiz = TRUE) axis (1, at = seq(0,600,10), l

[R] ff package when reading .csv files

2010-06-10 Thread dhanush
Hi My aim is to read a large .csv file into R. I ran the following code and am using R version 10.1 on Windows. >library(ff) > read.csv.ffdf(x=NULL,"file.csv",fileEncoding="",nrows=-1,first.rows=NULL,next.rows=NULL,levels=NULL,appendLevels=TRUE,FUN="read.table",transFUN=NULL,asffdf_args=list(),

Re: [R] points marking

2010-06-10 Thread Petr PIKAL
Hi I am not sure if you can do what you want. Segments are not points so your pch option is (I believe) ignored. You could play with lmitre and lend parameters, but it probably would not help much. You cold try to look at ?symbols but you probably need to change source code to suit your needs.

<    1   2