Re: [R] ggplot legend consolidation

2007-09-10 Thread hadley wickham
I have recently been introduced to the ggplot package by Hadley Wickham and must say I am quite impressed so far at how easy it is to make attractive plots, but one thing I am struggling over is how to consolidate legends. It's not currently possible to consolidate them (although

Re: [R] ggplot legend consolidation

2007-09-10 Thread hadley wickham
= 2, layout.pos.row = 2)) grid.rect() p.legend - get_legends(p) grid.draw(p.legend) --END CODE -Original Message- From: hadley wickham [mailto:[EMAIL PROTECTED] Sent: Monday, September 10, 2007 7:58 AM To: Te

Re: [R] stacking data frames with different variables

2007-09-09 Thread hadley wickham
Have a look at rbind.fill in the reshape package. Hadley On 9/9/07, Muenchen, Robert A (Bob) [EMAIL PROTECTED] wrote: Hi All, If I need to stack two data frames, I can use rbind, but it requires that all variables exist in both sets. I can make that happen, but other stat packages would

Re: [R] computing distance in miles or km between 2 street addre

2007-09-06 Thread hadley wickham
On 9/6/07, Ted Harding [EMAIL PROTECTED] wrote: On 06-Sep-07 18:42:32, Philip James Smith wrote: Hi R-ers: I need to compute the distance between 2 street addresses in either km or miles. I do not care if the distance is a shortest driving route or if it is as the crow flies. Does

[R] UseR! 2007 presentations and posters - now available

2007-09-04 Thread hadley wickham
Hi everyone, Many of the presentations and posters from UseR! 2007 are now available online: http://user2007.org/program/ If you presented and your slides or poster isn't up yet, please email a pdf version to me, [EMAIL PROTECTED], and I'll put it up. Regards, Hadley (And check out

Re: [R] Lattice: panel superpose with groups

2007-09-04 Thread hadley wickham
Hi Michael, It's not lattice, but you can easily do this with ggplot2: install.packages(ggplot2) library(ggplot2) qplot(year, yvar, data=df, facets = . ~ week, colour=factor(temp), geom=line) + stat_summary(aes(group=1), geom=line, fun=mean, size=2) Although you don't (currently) get the nice

Re: [R] Legend issue with ggplot2

2007-09-03 Thread hadley wickham
On 9/3/07, ONKELINX, Thierry [EMAIL PROTECTED] wrote: Dear useRs, I'm struggling with the new version of ggplot2. In the previous version I did something like this. But now this yield an error (object fill not found). library(ggplot2) dummy - data.frame(x = rep(1:10, 4), group = gl(4, 10))

Re: [R] plotting predicted curves with log scale in lattice

2007-09-03 Thread hadley wickham
Hi Ken, Alternatively, you could use ggplot2: install.packages(ggplot2) library(ggplot2) qplot(LL, RR, data=ds1, facets = . ~ FF) + geom_line(data=ds2) + scale_x_log10() It is very hard to get transformed scales working correctly, and it's something I had to spend a lot of time on in between

Re: [R] Legend issue with ggplot2

2007-09-03 Thread hadley wickham
conducted, is a delicate dissection of uncertainties, a surgery of suppositions. ~M.J.Moroney -Oorspronkelijk bericht- Van: hadley wickham [mailto:[EMAIL PROTECTED] Verzonden: maandag 3 september 2007 15:15 Aan: ONKELINX, Thierry CC: r-help@stat.math.ethz.ch Onderwerp: Re: [R

[R] [R-pkgs] ggplot2 - version 0.5.5

2007-09-02 Thread hadley wickham
ggplot2 === ggplot2 is a plotting system for R, based on the grammar of graphics, which tries to take the good parts of base and lattice graphics and avoid bad parts. It takes care of many of the fiddly details that make plotting a hassle (like drawing legends) as

Re: [R] Assigning line colors in xyplot

2007-08-31 Thread hadley wickham
On 8/31/07, Christof Bigler [EMAIL PROTECTED] wrote: The suggestions by Deepayan Sarkar and Hadley Wickham work for that case, but I get into troubles when I try to draw e.g. a panel for A and B: xyplot(y ~ x | f , groups=g, data=tmp,type=l, par.settings=list(superpose.line=list(col=c

Re: [R] Assigning line colors in xyplot

2007-08-30 Thread hadley wickham
Hi Christof, You can do this in ggplot, with one exception: install.packages(ggplot2) library(ggplot2) qplot(x, y, data=tmp, facets = . ~ g, geom=line, colour=f) Unfortunately I don't yet have an implementation of facetting that works like lattice, wrapping the line of plots in to 2d

Re: [R] fill circles

2007-08-26 Thread hadley wickham
Hi Christian, You could use the ggplot2 package (http://had.co.nz/ggplot2) which takes care of many of these details for you: qplot(Height, Volume, data=trees, size = Girth) qplot(Height, Volume, data=trees, size = Girth, colour=Height) You can find more details on the website about how to

Re: [R] uneven list to matrix

2007-08-24 Thread hadley wickham
On 8/23/07, Gabor Grothendieck [EMAIL PROTECTED] wrote: Here are two solutions. The first repeatedly uses merge and the second creates a zoo object from each alph component whose time index consists of the row labels and uses zoo's multiway merge to merge them. # test data m - matrix(1:5,

Re: [R] perception of graphical data

2007-08-24 Thread hadley wickham
Hi Richard, I apologize that this is off-topic. I am seeking information on perception of graphical data, in an effort to improve the plots I produce. Would anyone point me to literature reviews in this area? (Or keywords to try on google?) Is this located somewhere near cognitive

Re: [R] Need a variant of rbind for datasets with different numbers of columns

2007-08-23 Thread hadley wickham
You might try rbind.fill in the reshape package. Hadley On 8/22/07, Kirsten Beyer [EMAIL PROTECTED] wrote: Hello. I am looking for a function that will allow me to paste rows together without regard for the numbers of columns in the datasets to be joined. The only columns where it matters

Re: [R] recommended combo of apps for new user?

2007-08-19 Thread hadley wickham
On 8/18/07, John Kane [EMAIL PROTECTED] wrote: I'm just starting to get a grasp on how R works so don't take my words too seriously but have a look at http://addictedtor.free.fr/graphiques/ for some idea of what R can do for publication quality graphics. It is always possible that you might

[R] [R-pkgs] 'fda' 1.2.2 is now available on CRAN.

2007-08-14 Thread hadley wickham
., discussion paper to appear soon in the Journal of the Royal Statistical Society-series B. It also includes the draft of a presentation on fda in Matlab R (in PowerPoint and Adobe Acrobat PDF formats) for the UseR! 2007 conference this Friday, Aug. 10, 1:55 - 2:20 PM in Ames, IA. Regards Hadley

Re: [R] Help using gPath

2007-08-12 Thread hadley wickham
Here's a partial extract from a sample session after running your code (NOTE this is using the development version of R; grid.ls() does not exist in R 2.5.1 or earlier): Inspect the grob tree with grid.ls() (similar to Hadley's current.grobTree(), but with different formatting) ... (I'll

Re: [R] Classifly problems

2007-08-07 Thread hadley wickham
Have you tried using classifly directly? library(classifly) classifly(Tumor ~ ., my.data.set, lda) generate_classification_data is an internal function, and you are passing it the wrong arguments. Hadley On 8/7/07, Dani Valverde [EMAIL PROTECTED] wrote: Hello, I am trying to explore a

Re: [R] ggplot2 qplot and add

2007-08-04 Thread hadley wickham
On 8/4/07, Emilio Gagliardi [EMAIL PROTECTED] wrote: Dear Hadley, You are a machine! Its way past late you should be relaxing man ;) Thanks :) Here is what I hacked together. My question was how to pass in the colour used to fill the dot/legend and the label for the legend entries. test -

Re: [R] ggplot2 qplot and add

2007-08-03 Thread hadley wickham
On 8/2/07, Emilio Gagliardi [EMAIL PROTECTED] wrote: Hi Thierry and Hadley, Thanks for your help! I got it working almost 100% to what I want. My last questions are simple I think ;) 1) How can I pass a label to colour and assign the color at the same time? The auto-selection of colors is

Re: [R] ggplot2 qplot and add

2007-08-02 Thread hadley wickham
On 8/2/07, ONKELINX, Thierry [EMAIL PROTECTED] wrote: I think you need something like. qplot(appetitive.stimulus, graphLabels, data=related.differences, size=variance, colour=Appetitive Stimulus, xlim=c(-20,20), main=Title here, xlab=Differences, ylab=Header Concepts) + geom_point(aes(colour

Re: [R] Ggplot2 equivalent of axis and problem with log scale

2007-07-25 Thread hadley wickham
On 7/25/07, ONKELINX, Thierry [EMAIL PROTECTED] wrote: Dear useRs, Recently I've discorved ggplot2 and I must say that I really like it, although the documentation still is a working in progress. My first question: How can I change the position of the labels and the text of the labels? With

Re: [R] ggplot2 axis color

2007-07-24 Thread hadley wickham
Hi Felipe, Looks like a bug! I'll try and get it fixed for the next version. In the meantime, you can read the last chapter of the ggplot book to see how to fix it with grid. Hadley On 7/24/07, Felipe Carrillo [EMAIL PROTECTED] wrote: Hi: Does anyone have an idea on how to color the axis

Re: [R] xyplot for longitudinal data

2007-07-17 Thread hadley wickham
On 7/18/07, Osman Al-Radi [EMAIL PROTECTED] wrote: Dear R-help subscribers, I use xyplot to plot longitudinal data as follows: score-runif(100,-4,5) group-sample(1:4,100,rep=T) subject-rep(1:25,4) age-rep(runif(4,1,40),25) df-data.frame(score,group,age,subject) xyplot(score~age|group,

Re: [R] Alternative to xyplot()?

2007-07-17 Thread hadley wickham
On 7/18/07, Stephen Tucker [EMAIL PROTECTED] wrote: What's wrong with lattice? Here's an alternative: library(ggplot2) ggplot(data=data.frame(x,y,grps=factor(grps)), mapping=aes(x=x,y=y,colour=grps)) + # define data geom_identity() +# points

Re: [R] Different axis limits for each facet in ggplot2

2007-07-16 Thread hadley wickham
On 7/16/07, Karl Ove Hufthammer [EMAIL PROTECTED] wrote: Hi! Is it possible to have different axis limit for each facet in a ggplot2 plot? Here is an example: Not yet, although it is on the to do list. -- library(ggplot2)

Re: [R] how do I draw such a barplot?

2007-07-16 Thread hadley wickham
On 7/16/07, Donatas G. [EMAIL PROTECTED] wrote: Hi, I cannot figure out how to draw a certain plot: could someone help me out? I have this data.frame from a survey my.data that looks like something like this: col1 col2 col3 col4 1 5 5 4 5 2 3 5 3 1

Re: [R] Problem to sort factor

2007-07-16 Thread hadley wickham
On 7/16/07, Arne Brutschy [EMAIL PROTECTED] wrote: Hello, I'm having a problem renaming and sorting the underlying factor of a ggplot2 based plot. Here's my code: ---8-- delta - ggplot(subset(data, Model==c(dyn, dl4, dl3)), aes(x=Problemsize, y=Fitness)) + geom_smooth(size=1,

Re: [R] scaling of different data sets in ggplot

2007-07-16 Thread hadley wickham
Hi Stephen, You can't do that in ggplot (have two different scales) because I think it's generally a really bad idea. The whole point of plotting the data is so that you can use your visual abilities to gain insight into the data. When you have two different scales the positions of the two

Re: [R] Send SMS out of R?

2007-07-15 Thread hadley wickham
On 7/14/07, Thomas Schwander [EMAIL PROTECTED] wrote: Hi everyone, Now I read the posting guidelines again; COMPLETELY! ;-) I use Windows XP Professional, R 2.5.1 and I have Blat to send eMails out of R. Works perfect! Thank you for your help! Now I want to send an SMS out of R! Any

Re: [R] Break during the recursion?

2007-07-15 Thread hadley wickham
On 7/15/07, Duncan Murdoch [EMAIL PROTECTED] wrote: On 15/07/2007 11:36 AM, Atte Tenkanen wrote: On 15/07/2007 10:33 AM, Atte Tenkanen wrote: On 15/07/2007 10:06 AM, Atte Tenkanen wrote: Hi, Is it possible to break using if-condition during the recursive function? You can do if

Re: [R] Break during the recursion?

2007-07-15 Thread hadley wickham
On 7/15/07, Atte Tenkanen [EMAIL PROTECTED] wrote: Here is now more elegant function for inorder tree walk, but I still can't save the indexes!? This version now prints them ok, but if I use return, I get only the first v[i]. leftchild-function(i){return(2*i)}

Re: [R] Restructuring data

2007-07-15 Thread hadley wickham
On 7/16/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: On 7/15/07, Daniel Malter [EMAIL PROTECTED] wrote: Hi folks, I am new to the list and relatively new to R. I am trying to unstack data arraywise and could not find a convenient solution yet. I tried to find a solution for the

Re: [R] ggplot usage question

2007-07-14 Thread hadley wickham
On 7/14/07, Pete Kazmier [EMAIL PROTECTED] wrote: Could someone show me how to get a blue line in this plot? ggplot(movies, aes(x=rating)) + stat_qq(geom=line, quantiles=seq(0,1,0.005), distribution=qunif) It's a bug in ggplot, sorry. It will be fixed in the next version. Hadley

Re: [R] ggplot2 / histogram / y-axis

2007-07-13 Thread hadley wickham
On 7/12/07, Pete Kazmier [EMAIL PROTECTED] wrote: hadley wickham [EMAIL PROTECTED] writes: On 7/12/07, Pete Kazmier [EMAIL PROTECTED] wrote: Is there a way in ggplot to make a histogram with the left-hand y-axis label as frequency, and a right-hand y-axis label as percentage

Re: [R] Choosing the number of colour breaks in ggplot2

2007-07-13 Thread hadley wickham
Hi Karl, There's no official way to do it, but you can hack the colour gradient scale to do what you want: x=-10:10 y=-10:10 dat=expand.grid(x=x,y=y) dat$z=dat$x^2+dat$y^2-100 # Create a modified scale gr - scale_fill_gradient2()$clone() gr$breaks - function(.) seq(-100, 100, by=10)

Re: [R] help with handling replicates before reshaping data

2007-07-13 Thread hadley wickham
Hi Tom, I have a dataset consists of duplicated sequences within day for each patient (see below data) and I want to reshape the data with patient as time variable. However the reshape function only takes the first sequence of the replicates and ignores the second. How can I 1) average

Re: [R] ggplot2 / reshape / Question on manipulating data

2007-07-12 Thread hadley wickham
On 7/12/07, Pete Kazmier [EMAIL PROTECTED] wrote: I'm an R newbie but recently discovered the ggplot2 and reshape packages which seem incredibly useful and much easier to use for a beginner. Using the data from the IMDB, I'm trying to see how the average movie rating varies by year. Here is

Re: [R] ggplot doesnt work in loops?

2007-07-12 Thread hadley wickham
Hi Steve, You need to explicitly print the ggplot object: ggplot(mydata, aes(x=mydata$varc)) + geom_bar() (this is a R-faq for lattice plots, and ggplot works the same way) In the latest version of ggplot (0.5.4) you can construct the plot before hand and modify the aesthetics in each instance

Re: [R] how to get the p-values from an lm function ?

2007-07-12 Thread hadley wickham
On 7/12/07, Benoit Chemineau [EMAIL PROTECTED] wrote: Hi, dear R-users, I am computing a liner regression by rating category using the 'by' function as stated below: tmp - by(projet, rating, function(x) lm(defaults ~ CGDP+CSAVE+SP500, data = x)) I would like to get not only the

Re: [R] how to get the p-values from an lm function ?

2007-07-12 Thread hadley wickham
On 7/12/07, Prof Brian Ripley [EMAIL PROTECTED] wrote: On Thu, 12 Jul 2007, hadley wickham wrote: On 7/12/07, Benoit Chemineau [EMAIL PROTECTED] wrote: Hi, dear R-users, I am computing a liner regression by rating category using the 'by' function as stated below: tmp - by(projet

Re: [R] p-value from survreg

2007-07-12 Thread hadley wickham
On 7/12/07, Terry Therneau [EMAIL PROTECTED] wrote: The question was how to get the p-value from the fit below, as an S object sr-survreg(s~groups, dist=gaussian) Coefficients: (Intercept) groups -0.02138485 0.03868351 Scale= 0.01789372 Loglik(model)= 31.1 Loglik(intercept only)=

Re: [R] ggplot doesnt work in loops?

2007-07-12 Thread hadley wickham
On 7/12/07, hadley wickham [EMAIL PROTECTED] wrote: Hi Steve, You need to explicitly print the ggplot object: ggplot(mydata, aes(x=mydata$varc)) + geom_bar() (this is a R-faq for lattice plots, and ggplot works the same way) In the latest version of ggplot (0.5.4) you can construct

Re: [R] ggplot2 / reshape / Question on manipulating data

2007-07-12 Thread hadley wickham
On 7/12/07, Pete Kazmier [EMAIL PROTECTED] wrote: hadley wickham [EMAIL PROTECTED] writes: On 7/12/07, Pete Kazmier [EMAIL PROTECTED] wrote: I'm an R newbie but recently discovered the ggplot2 and reshape packages which seem incredibly useful and much easier to use for a beginner. Using

Re: [R] ggplot2 / histogram / y-axis

2007-07-12 Thread hadley wickham
On 7/12/07, Pete Kazmier [EMAIL PROTECTED] wrote: Is there a way in ggplot to make a histogram with the left-hand y-axis label as frequency, and a right-hand y-axis label as percentage? Not currently. I did a quick exploration to see if it was feasible to draw another axis on with grid, but it

Re: [R] How to plot two variables using a secondary Y axis

2007-07-11 Thread hadley wickham
On 7/10/07, Felipe Carrillo [EMAIL PROTECTED] wrote: Date Fo Co6/27/2007 57.1 13.96/28/2007 57.7 14.3 6/29/2007 57.8 14.36/30/2007 57 13.97/1/2007 57.1 13.9 7/2/2007 57.2 14.07/3/2007 57.3 14.17/4/2007 57.6 14.2 7/5/2007 58 14.4

Re: [R] p-value from survreg(), library(survival)

2007-07-11 Thread hadley wickham
str(survreg(s~groups, dist=gaussian)) is probably a good place to start. Hadley On 7/11/07, Vlado Sremac [EMAIL PROTECTED] wrote: dear r experts: It seems my message got spam filtered, another try: i would appreciate advice on how to get the p-value from the object 'sr' created with the

Re: [R] p-value from survreg(), library(survival)

2007-07-11 Thread hadley wickham
On 7/11/07, Marc Schwartz [EMAIL PROTECTED] wrote: Actually, in this case, looking at the code for: survival:::print.survreg would be better, as the p value is calculate there, rather than being part of the survreg object. As with many R functions, the p value is calculated in the print

Re: [R] Drawing rectangles in multiple panels

2007-07-11 Thread hadley wickham
A question/comment: I have usually found that the subscripts argument is what I need when passing *external* information into the panel function, for example, when I wish to add results from a fit done external to the trellis call. Fits[subscripts] gives me the fits (or whatever) I want to

Re: [R] Drawing rectangles in multiple panels

2007-07-11 Thread hadley wickham
On 7/12/07, Deepayan Sarkar [EMAIL PROTECTED] wrote: On 7/11/07, hadley wickham [EMAIL PROTECTED] wrote: A question/comment: I have usually found that the subscripts argument is what I need when passing *external* information into the panel function, for example, when I wish to add

Re: [R] Drawing rectangles in multiple panels

2007-07-11 Thread hadley wickham
On 7/12/07, Stephen Tucker [EMAIL PROTECTED] wrote: Not that Trellis/lattice was entirely easy to learn at first. :) I've been playing around with ggplot2 and there is a plot()-like wrapper for building a quick plot [incidentally, called qplot()], but otherwise it's my understanding that you

Re: [R] Drawing rectangles in multiple panels

2007-07-11 Thread hadley wickham
On 7/12/07, Stephen Tucker [EMAIL PROTECTED] wrote: In the Trellis approach, another way (I like) to deal with multiple pieces of external data sources is to 'attach' them to panel functions through lexical closures. For instance... rectInfo - list(matrix(runif(4), 2, 2),

Re: [R] overlay boxplot

2007-07-10 Thread hadley wickham
You will get more useful answers if you specify exactly how you want to overlay the boxplots (overlay them on what?). You can certainly do this with the ggplot2 package, or lattice or base graphics. Hadley On 7/10/07, Hao Liu [EMAIL PROTECTED] wrote: hi, All: I need to overlay two boxplot, I

[R] [R-pkgs] ggplot 0.5.4

2007-07-09 Thread hadley wickham
ggplot2 === ggplot2 is a plotting system for R, based on the grammar of graphics, which tries to take the good parts of base and lattice graphics and avoid bad parts. It takes care of many of the fiddly details that make plotting a hassle (like drawing legends) as

Re: [R] using the function unique(), but asking it to ignore a column of a data.frame

2007-07-09 Thread hadley wickham
On 7/9/07, Andrew Yee [EMAIL PROTECTED] wrote: Take for example the following data.frame: a-c(1,1,5) b-c(3,2,3) c-c(5,1,5) sample.data.frame-data.frame(a=a,b=b,c=c) I'd like to be able to use unique(sample.data.frame), but have unique() ignore column a when determining the unique

Re: [R] about scagnostics

2007-07-09 Thread hadley wickham
Hi Olivier, You can call scagnostics either with two vectors, or a data.frame (in which case it computes all pairwise scagnostics). I just double checked to make sure I didn't accidentally misname the vector of scagnostics in R, and it doesn't look like I did, so could you please send me a

Re: [R] using the function unique(), but asking it to ignore a column of a data.frame

2007-07-09 Thread hadley wickham
On 7/9/07, Peter Dalgaard [EMAIL PROTECTED] wrote: Andrew Yee wrote: Thanks. But in this specific case, I would like the output to include all three columns, including the ignored column (in this case, I'd like it to ignore column a). df[!duplicated(df[,c(a,c)]),] or perhaps

Re: [R] possible bug in ggplot2 v0.5.2???

2007-07-09 Thread hadley wickham
On 7/6/07, Prof Brian Ripley [EMAIL PROTECTED] wrote: On Wed, 4 Jul 2007, hadley wickham wrote: On 7/4/07, Prof Brian Ripley [EMAIL PROTECTED] wrote: On Tue, 3 Jul 2007, hadley wickham wrote: Hi Stephane, The problem is that the windows graphics device doesn't support

[R] [R-pkgs] Reshape version 0.8

2007-07-09 Thread hadley wickham
Reshape version 0.8 http://had.co.nz/reshape Reshape is an R package for flexibly restructuring and aggregating data. It's inspired by Excel's pivot tables, and it (hopefully) makes it very easy to get your data into the shape that you want. You can find out more at http://had.co.nz/reshape

[R] [R-pkgs] Scagnostics - scatterplot diagnostics

2007-07-08 Thread hadley wickham
The scagnostics package implements the graph theoretic scagnostics described by Leland Wilkinson, Anushka Anand and Robert Grossman (http://www.ncdm.uic.edu/publications/files/proc-094.pdf), building on an old idea of Tukey's to define indices of interestingness to help guide the search for

Re: [R] ggplot2 customizing

2007-07-05 Thread hadley wickham
Hi Ido, On 7/5/07, Ido M. Tamir [EMAIL PROTECTED] wrote: Dear all, I know that ggplot2 documentation is coming along, but at the moment I can't find how to do the following: a) change the title of the legend There's lot of examples in the documentation - and you seem to have figured how to

Re: [R] possible bug in ggplot2 v0.5.2???

2007-07-04 Thread hadley wickham
On 7/4/07, Prof Brian Ripley [EMAIL PROTECTED] wrote: On Tue, 3 Jul 2007, hadley wickham wrote: Hi Stephane, The problem is that the windows graphics device doesn't support transparent colours. You can get around this in two ways: It certainly does! Try col=transparent (and perhaps

Re: [R] possible bug in ggplot2 v0.5.2???

2007-07-03 Thread hadley wickham
Hi Stephane, The problem is that the windows graphics device doesn't support transparent colours. You can get around this in two ways: * export to a device that does support transparency (eg. pdf) * use a solid fill colour : + stat_smooth(method=lm, fill=grey50) Hadley On 7/3/07, Stephane

Re: [R] Plots from categorial data

2007-07-01 Thread hadley wickham
Perhaps this will do what you want: library(ggplot2) qplot(filter_setting, avg.hit, data=data, colour=ocrtool, geom=line) find out more about ggplot2 at http://had.co.nz/ggplot2 Hadley On 7/1/07, Christoph Krammer [EMAIL PROTECTED] wrote: Hello everybody, Since my first message was caught

Re: [R] Plots from categorial data

2007-07-01 Thread hadley wickham
On 7/1/07, Christoph Krammer [EMAIL PROTECTED] wrote: Hello Hadley, Thanks a lot for your help. I got the plot I want out of this module with a slightly more complicated command. But now, I have an additional problem: In the given case, the filtersetting column contains letters, so R takes

[R] [R-pkgs] Clusterfly

2007-07-01 Thread hadley wickham
clusterfly http://had.co.nz/clusterfly/ Typically, there is somewhat of a divide between statistics and visualisation software. Statistics software, particularly R, provides implementation of cutting edge research methods, but limited graphics. Visualisation software will provide sophisticated

Re: [R] Adding different output to different lattice panels

2007-06-28 Thread hadley wickham
On 6/28/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I would like to add a reference line to lattice graphs, with the reference line being different according to the factor level. Example : Draw 3 dotplots for a,b and c factors, and then add an horizontal line at y=10 for panel a, y=8 for

Re: [R] Error en assign(mname, def, where)

2007-06-28 Thread hadley wickham
Hi Martin, Could you please provide a minimal replicable example so that we can investigate further. Thanks, Hadley On 6/28/07, Martín Gastón [EMAIL PROTECTED] wrote: Hi R users, I am working with the fda package but when I call the function pca.fd I obtain a message error, which I cann't

Re: [R] how to plot this?

2007-06-25 Thread hadley wickham
On 6/25/07, jim holtman [EMAIL PROTECTED] wrote: You might want to check out this link to the type of graphs that R can produce and find one you like; the code will be with it. http://addictedtor.free.fr/graphiques/allgraph.php Or for examples using the ggplot2 package:

Re: [R] Overlaying lattice graphs (continued)

2007-06-22 Thread hadley wickham
won't be too hard to changed. Can I modify the aspect of each group using your code (symbols for observed and lines for predicted)? Sebastien hadley wickham a écrit : Hi Sebastian, I think you need to rearrange your data a bit. Firstly, you need to put observed on the same

Re: [R] Switching X-axis and Y-axis for histogram

2007-06-22 Thread hadley wickham
It's trivial to do this with ggplot2 (http://had.co.nz): qplot(rating, data=movies, geom=histogram) + coord_flip() qplot(rating, data=movies, geom=histogram, binwidth=0.1) + coord_flip() Hadley On 6/22/07, Donghui Feng [EMAIL PROTECTED] wrote: Dear all, I'm creating a histogram with the

Re: [R] Stacked barchart color

2007-06-22 Thread hadley wickham
Hi Owen, The bars should be stacked in the order specified by the factor. Try using factor(..., levels=...) to explicitly order them the way you want. If that doesn't work, please provide a small replicable example and I'll look into it. Hadley On 6/18/07, owenman [EMAIL PROTECTED] wrote:

Re: [R] Visualize quartiles of plot line

2007-06-22 Thread hadley wickham
On 6/17/07, Arne Brutschy [EMAIL PROTECTED] wrote: Hi, thanks for your tips - all of them worked. After a bit of fiddling, I managed to get what I wanted. Glad to hear it. hadley wickham wrote: h You might want to read the introductory chapters in the ggplot book, h available from http

Re: [R] Overlaying lattice graphs (continued)

2007-06-22 Thread hadley wickham
Yes - you'll need ggplot2. Hadley On 6/22/07, Sébastien [EMAIL PROTECTED] wrote: Hadley, I have some troubles to run your code with ggplot version 0.4.1. Is the package ggplot2 mandatory ? Sebastien hadley wickham a écrit : Hi Sebastian, I think the following does what you want

Re: [R] Overlaying lattice graphs (continued)

2007-06-21 Thread hadley wickham
Hi Sebastian, I think you need to rearrange your data a bit. Firstly, you need to put observed on the same footing as the different models, so you would have a new column in your data called value (previously observed and predicted) and a new model type (observed). Then you could do:

Re: [R] Overlaying lattice graphs (continued)

2007-06-21 Thread hadley wickham
modify the aspect of each group using your code (symbols for observed and lines for predicted)? Sebastien hadley wickham a écrit : Hi Sebastian, I think you need to rearrange your data a bit. Firstly, you need to put observed on the same footing as the different models, so you would

[R] [R-pkgs] ggplot2 0.5.2

2007-06-19 Thread hadley wickham
ggplot2 === ggplot2 is a plotting system for R, based on the grammar of graphics, which tries to take the good parts of base and lattice graphics and none of the bad parts. It takes care of many of the fiddly details that make plotting a hassle (like drawing

Re: [R] Controlling text and strip arrangement in xyplot

2007-06-19 Thread hadley wickham
On 6/19/07, Juan Pablo Lewinger [EMAIL PROTECTED] wrote: I've searched the archives and read the xyplot help but can't figure out the 2 lattice questions below? Consider: library(lattice) DF - data.frame(x=rnorm(20), y=rnorm(20), g1=rep(letters[1:2], 10),

Re: [R] Visualize quartiles of plot line

2007-06-17 Thread hadley wickham
On 6/17/07, Arne Brutschy [EMAIL PROTECTED] wrote: Hi, concerning the missing se coloring: I followed the examples on http://had.co.nz/ggplot2/stat_smooth.html c - ggplot(mtcars, aes(y=wt, x=qsec)) c + stat_smooth() c + stat_smooth() + geom_point() c + stat_smooth(se = TRUE) +

Re: [R] Visualize quartiles of plot line

2007-06-17 Thread hadley wickham
On 6/17/07, Arne Brutschy [EMAIL PROTECTED] wrote: Hi, h How about quantile regression? Have a look at h http://had.co.nz/ggplot2/stat_quantile.html for some examples of h what that might look like. I tried the ggplot2 package, it seems to be quite powerful. But documentation is only

Re: [R] [ggplot2] Change color of grid lines

2007-06-17 Thread hadley wickham
On 6/17/07, Bernd Weiss [EMAIL PROTECTED] wrote: Hi, I am making myself familiar with ggplot2 (I really like the examples at http://had.co.nz/ggplot2/). One thing that really annoys me is the default use of white grid lines and a gray background [1, 2]. I simply would like to have black

Re: [R] Stacked barchart color

2007-06-16 Thread hadley wickham
On 6/16/07, owenman [EMAIL PROTECTED] wrote: Hi Hadley, I tried your suggestion, using ggplot2, but I am still having a problem. The final plot lacks the figure legend -- which it had before I added the scale_fill_identity() bit. Can you see what I am doing wrong? (By the way, all I am

Re: [R] Visualize quartiles of plot line

2007-06-16 Thread hadley wickham
How about quantile regression? Have a look at http://had.co.nz/ggplot2/stat_quantile.html for some examples of what that might look like. Hadley On 6/16/07, Arne Brutschy [EMAIL PROTECTED] wrote: Hello, I'm currently using a simple plot to visualize some mean values. I'm having ~200

Re: [R] problem with hist()

2007-06-15 Thread hadley wickham
On 6/14/07, Mario Dejung [EMAIL PROTECTED] wrote: Hey everybody, I try to make a graph with two different plots. First I make a boxplot of my data. It is a collection off correlation values of different pictures. For example: 0.23445 pica 0.34456 pica 0.45663 pica 0.98822 picb 0.12223

Re: [R] problem with hist()

2007-06-15 Thread hadley wickham
On 6/15/07, Mario Dejung [EMAIL PROTECTED] wrote: On 6/14/07, Mario Dejung [EMAIL PROTECTED] wrote: Hey everybody, I try to make a graph with two different plots. First I make a boxplot of my data. It is a collection off correlation values of different pictures. For example:

Re: [R] back-transform predictors for x-axis in plot -- mgcv package

2007-06-15 Thread hadley wickham
Hi Suzan, You can do sort of backtransformation inside of ggplot2 (http://had.co.nz/ggplot2). library(ggplot2) # Create the base scatterplot with y and x axes transformed by logging, # and then back transformed by exponentiating (base - qplot(carat, price, data=diamonds) + scale_x_log10() +

Re: [R] [OT] 'gv' and fractional points

2007-06-15 Thread hadley wickham
This doesn't answer your original question, and isn't much help unless you're on a mac, but there's a nice looking program that makes this kind of graph scraping really easy: http://www.arizona-software.ch/applications/graphclick/en/ Hadley On 6/15/07, Ted Harding [EMAIL PROTECTED] wrote: Hi

Re: [R] model.frame: how does one use it?

2007-06-15 Thread hadley wickham
On 6/15/07, Deepayan Sarkar [EMAIL PROTECTED] wrote: On 6/15/07, Dirk Eddelbuettel [EMAIL PROTECTED] wrote: Philipp Benner reported a Debian bug report against r-cran-rpart aka rpart. In short, the issue has to do with how rpart evaluates a formula and supporting arguments, in particular

Re: [R] Confusion with sapply

2007-06-13 Thread hadley wickham
On 6/13/07, Patnaik, Tirthankar [EMAIL PROTECTED] wrote: Hi, I have some confusion in applying a function over a column. Here's my function. I just need to shift non-March month-ends to March month-ends. Initially I tried seq.dates, but one cannot give a negative increment (decrement) here.

Re: [R] [OT]Web-Based Data Brushing

2007-06-12 Thread hadley wickham
On 6/12/07, Roy Mendelssohn [EMAIL PROTECTED] wrote: I apologize for the off-topic post, but my Google search did not turn up much and I thought people on this list my have knowledge of this. I am looking for examples of data brushing (i.e. dynmaic linked plots) either on a web site, or in a

Re: [R] Stacked barchart color

2007-06-12 Thread hadley wickham
On 6/12/07, Dieter Menne [EMAIL PROTECTED] wrote: Dear Latticer, I want to give individual colors to all elements in a simple stacked barchart. I know why the example below does not work (and it is a excellent default), but is there any workaround for this? Dieter # This only colors red

Re: [R] Overlaying lattice graphs

2007-06-12 Thread hadley wickham
On 6/12/07, Seb [EMAIL PROTECTED] wrote: Hello I apologize in advance if this question has already be posted on the list, although I could not find a relevant thread in the archives. I would like to overlay xyplots using different datasets for each plot. I typically work on the following

Re: [R] comparing two vectors

2007-06-10 Thread hadley wickham
On 6/10/07, gallon li [EMAIL PROTECTED] wrote: Suppose I have a vector A=c(1,2,3) now I want to compare each element of A to another vector L=c(0.5, 1.2) and then recode values for sum(A0.5) and sum(A1.2) to get a result of (3,2) how can I get this without writing a loop of sums? How

[R] [R-pkgs] Updated ggplot2 package (beta version)

2007-06-10 Thread hadley wickham
ggplot2 === ggplot2 is a plotting system for R, based on the grammar of graphics, which tries to take the good parts of base and lattice graphics and none of the bad parts. It takes care of many of the fiddly details that make plotting a hassle (like drawing

Re: [R] Barplots: Editing the frequency x-axis names

2007-06-08 Thread hadley wickham
On 6/8/07, Tom.O [EMAIL PROTECTED] wrote: Hi I have a timeSeries object (X) with monthly returns. I want to display the returns with a barplot, which I can fix easily. But my problem is labaling the x-axis, if I use the positions from the timeseries It gets very messy. I have tried rotating

Re: [R] rlm results on trellis plot

2007-06-08 Thread hadley wickham
On 6/7/07, Alan S Barnett [EMAIL PROTECTED] wrote: How do I add to a trellis plot the best fit line from a robust fit? I can use panel.lm to add a least squares fit, but there is no panel.rlm function. It's not trellis, but it's really easy to do this with ggplot2: install.packages(ggplot2,

Re: [R] wrapping lattice xyplot

2007-06-08 Thread hadley wickham
On 6/8/07, Zack Weinberg [EMAIL PROTECTED] wrote: This is an expanded version of the question I tried to ask last night - I thought I had it this morning, but it's still not working and I just do not understand what is going wrong. What I am trying to do is write a wrapper for lattice

Re: [R] generating many matrices

2007-06-06 Thread hadley wickham
On 6/6/07, Keun-Hyung Choi [EMAIL PROTECTED] wrote: I'd like to generate many matrices (let's say 100 matrices of 4x4), of which diagonal elements are being drawn from each set of sample of known distribution. What would be the best way? I've been trying to find any previous threads for

  1   2   3   4   5   >