Re: [R] aggregate() - error message

2009-09-24 Thread Paul Emberson
Hi, Are you trying to get columns 2 and 3 from TripsData in which case you need to say TripsData[,2:3] ? Paul Juliane Struve wrote: Dear list, would anybody be able to tell me why the statement Tripstatistics=aggregate(TripsData[2:3],by=list(Trip=Tripmatch),FUN="mean") seems to work w

Re: [R] ggplot: colours to geom_segments

2009-08-11 Thread Paul Emberson
Hi John, Try pa + scale_colour_brewer() and see ?scale_colour_brewer for options Also see scale_colour_manual where you can use the values parameter to choose your own colours. Cheers, Paul John Kane wrote: >> Paul Emberson "You need to map colour to a variable. Try >> geo

Re: [R] Check functions in package

2009-07-28 Thread Paul Emberson
Hi, You can use help to view the available help files with the package. E.g. for survival package help(package=survival) Cheers, Paul voidobscura wrote: > Hi, I run R on a server via SSH, over a terminal. After loading a specific > package, how do I know what functions are in that package? I

Re: [R] Density plot in ggplot2

2009-07-28 Thread Paul Emberson
Hi Ron, I'm not sure why ylab doesn't work. Maybe a bug. I note the label doesn't get removed with labs() either. However using scale_y_continuous(name="") does remove the label. For the legend, you are using a fill scale, not a colour scale i.e. fill=factor(dat[,2]), not colour=factor(da

Re: [R] a question about replacing a column that is factor

2009-07-25 Thread Paul Emberson
Hi, You can add extra levels using levels(). e.g. > test <- data.frame(x=c(1,2,4,4), y=c("A", 1, 2, "A")) > levels(test$y) <- c(levels(test$y), 'B') > levels(test$y) [1] "1" "2" "A" "B" > test[test$x==4,]$y<-'B' > test x y 1 1 A 2 2 1 3 4 B 4 4 B Regards, Paul jlfmssm wrote: Sorry, I didn

Re: [R] Deleting .RData files

2009-07-25 Thread Paul Emberson
Hi John, You can use rm(object) to delete a specific object from the current environment and then save your workspace again without those objects ls() to see a list of objects could also be useful Regards, Paul John Seppänen wrote: > Hi all! I have accidentially saved few objects when I hav

Re: [R] ggplot2: annotating plot with mathematical formulae

2009-05-16 Thread Paul Emberson
he wiki page. > > HTH, > > baptiste > > On 16 May 2009, at 14:48, Paul Emberson wrote: > >> Hi Stephen, >> >> The problem is that the label on the graph doesn't get rendered with a >> superscript. I want the label on the graph to be rendered the sam

Re: [R] ggplot2: annotating plot with mathematical formulae

2009-05-16 Thread Paul Emberson
efick wrote: > how about this > > a <- 1:10 > b <- 1:10 > d <- paste("x","^","{n-1}") > qplot(a,b, xlab=expression(x^{n-1}))+geom_text(aes(4,8, label=d)) > > On Fri, May 15, 2009 at 10:02 PM, Paul Emberson > wrote: > >>

[R] ggplot2: annotating plot with mathematical formulae

2009-05-15 Thread Paul Emberson
Hi, Is there a way of annotating a ggplot plot with mathematical formulae? I can do geom_text(aes(label="some text", ... but I can't do geom_text(aes(label=expression(x^{n-1}), ... It gives the error Error: geom_text requires the following missing aesthetics: label Is there a convenient equ

[R] 64 bit R double precision

2009-05-07 Thread Paul Emberson
Hi, If R is compiled for a 64 bit platform, does the double data type make use of the additional precision or is it set at a fixed length? Thanks, Paul __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read

Re: [R] Do you use R for data manipulation?

2009-05-06 Thread Paul Emberson
I also use the approach Philipp describes below. I use Python and shell scripts for processing thousands of input files and getting all the data into one tidy csv table. From that point onwards it's R all the way (often with the reshape package). Paul Philipp Pagel wrote: On Wed, May 06, 2

[R] ggplot2: positioning legend on top of plot

2008-11-24 Thread Paul Emberson
Hi, With ggplot2 v0.8, how do I position a legend on top of the plot. Things like p + opts(legend.position="top") work ok. But p + opts(legend.position=c(0.5,0.5)) gives Error in as.character(x) : cannot coerce type 'closure' to vector of type 'character' so obviously I should be givin

Re: [R] ggplot2: problem with large fonts and overlapping labels

2008-08-28 Thread Paul Emberson
. ~ John Tukey -Oorspronkelijk bericht- Van: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Namens Paul Emberson Verzonden: woensdag 27 augustus 2008 17:58 Aan: r-help@r-project.org Onderwerp: [R] ggplot2: problem with large fonts and overlapping labels Hi, I am using ggplot2 to generate graphs

Re: [R] ggplot2: problem with large fonts and overlapping labels

2008-08-28 Thread Paul Emberson
-- Van: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Namens Paul Emberson Verzonden: woensdag 27 augustus 2008 17:58 Aan: r-help@r-project.org Onderwerp: [R] ggplot2: problem with large fonts and overlapping labels Hi, I am using ggplot2 to generate graphs for a paper I am writing in two column forma

[R] ggplot2: problem with large fonts and overlapping labels

2008-08-27 Thread Paul Emberson
Hi, I am using ggplot2 to generate graphs for a paper I am writing in two column format. When I shrink the graphs to fit in a single column, the graph is clear but the axis and tick labels are way too small. I have increased the font sizes by manipulating the grid. However, when I do this

[R] ggplot2: remove minor-horizontal guide before drawing

2008-08-14 Thread Paul Emberson
Hi, I want to remove minor-horizontal and minor-vertical lines from a plot generated with ggplot2. I can do this after the plot has been drawn using grid.gremove. However, I would like to do it before drawing my plot. The ggplot2 book refers to a ggplotGrob function which creates a grob fr

Re: [R] function to transform response of a formula

2008-07-30 Thread Paul Emberson
, n does not exist. Is there a way I can change my function so that n is replaced by its value within the formula created by f? Thanks, Paul [EMAIL PROTECTED] wrote: Its ok. I've just read about update.formula in another message. Paul Paul Emberson wrote: Hi, I am trying to write

[R] function to transform response of a formula

2008-07-30 Thread Paul Emberson
0.877736972644925) ~ a + b > terms(newfm) Error in terms.formula(fmapply(fm, identity)) : invalid term in model formula Could someone put me in the right direction of how to correctly write a respapply function as described. Regards, Paul Emberson __