Re: [R] Simple Problem: Plotting mathematical functions

2012-04-12 Thread Matthieu Dubois
e parameter add=TRUE is used to add the second function to the previous plot. HTH Matthieu Matthieu Dubois Post-doctoral fellow, Psychology Department, Univeristé Libre de Bruxelles __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman

Re: [R] Plot of function seems to cut off near edge of domain

2012-03-27 Thread Matthieu Dubois
o arguments that are passed to curve(): #Figure 2, with xlim beyond the radius of the circle plot(g,axes=F,from=0, to =50, xlim=c(0, 60), ylim=c(0,60)) axis(1,pos=0) axis(2,pos=0) HTH Matthieu Matthieu Dubois Post-doctoral researcher Psychology Department Université Libre d

Re: [R] dotplots with error bars

2012-02-13 Thread Matthieu Dubois
Colin Wahl gmail.com> writes: > > Does anyone have any recommendations for producing dotplots with error > bars? Are there packages available for this? I searched far and wide > and cannot find a suitable option. Dear Colin, have a look at this page from the R wiki: http://rwiki.sciviews.org/

Re: [R] Sweave for inclusion of p value in a sentence of a LaTeX document

2010-08-07 Thread Matthieu Dubois
lt;- t.test(x,y) @ The p value for my data was \Sexpr{ round(t$p.value, 3) } which is not significant. \end{document} Best, Matthieu Matthieu Dubois Post-doctoral researcher Department of Psychology and Neural Science, NYU __ R-help@r-project.org mai

Re: [R] To add text in a matrix

2010-01-14 Thread Matthieu Dubois
You can also use the comment() function to add comments to any kind of R object. Matthieu Dubois __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting

Re: [R] A ggplot question

2009-12-02 Thread Matthieu Dubois
Hi Megh, just set the legned position to 'none' using options, by putting + opts(legend.position="none") after your code. ggplot(diamonds, aes(carat, ..density..)) + geom_histogram(binwidth = 0.2, aes(fill = cut)) + facet_grid(. ~ cut) + opts(legend.position="none") HTH, Matthieu __

Re: [R] How to plot multiple data sets with different colors (also with legend)?

2009-10-18 Thread Matthieu Dubois
Hi, the blue point is not shown simply because it is printed outside the current plot area. If you want to use the base graphics, you have to manually define the xlim and ylim of the plot. Legend is added with the command "legend". E.g. x=rbind(c(10,11),c(10,11)) y=cbind(-1:0,-1:0) plot(y,co

Re: [R] ggplot2: mixing colour and linetype in geom_lin e

2009-09-10 Thread Matthieu Dubois
Hi Benoit, I'm not a specialist of ggplot2, but I will try to help. You may obtain more --interesting-- answers on the ggplot2 mailing list. This said, let's go. To solve your problem, I would suggest to 1. change the form of the data frame (using the reshape library) in order to have one v

Re: [R] predicting from segmented regression

2009-09-04 Thread Matthieu Dubois
dear Claudia, I was recently in touch with Vito Muggeo (the developer of the segmented package) with a similar question. This is an adapted version of his answer to your problem. In fact, the essential aspect is that predict.segmented has not (yet?) been implemented. Nevertheless, you could u

Re: [R] Density plot in ggplot2

2009-07-28 Thread Matthieu Dubois
Hi, small modifications to your code will do the trick > Here everything is ok, except few points : > 1. I want to remove the name of y-axis, which is by default "density". Here > I put ylab(""), however although for x-axis it is working, for y-axis it is > not. Is there any specific formula for

Re: [R] param:qsec in ggplot2

2009-07-23 Thread Matthieu Dubois
Hi, qseq is a variable from the data.frame mtcars, that has been used to create the initial plot p. library(ggplot2) p <- ggplot(mtcars, aes(wt, mpg)) p + geom_point(aes(size = qsec) Just replace qseq by your variable of interest. Regards, Matthieu ___

Re: [R] Aligning axis values when plotting more than one gr aph on same axes

2009-06-15 Thread Matthieu Dubois
Dear Steve, it will be difficult to help you without the code you are using to produce the plots. Could you please post a complete example with some (possibly generated) data and your code ? Regards, Matthieu Matthieu Dubois Post-doctoral fellow Psychology and NeuroCognition Lab Grenoble

Re: [R] how to adding colors to data points in scatter plot in R?

2009-05-23 Thread Matthieu Dubois
Simply use the col paramater, with a factor to index the colors. Example: # generate some data x <- rnom(100) y <- rnorm(x) z <- as.factor(rbinom(x,1,0.5)) # plot plot(x,y, col=c('red','blue')[z]) HTH, Matthieu __ R-help@r-project.org mailing list

Re: [R] Overlay cdf

2009-05-13 Thread Matthieu Dubois
You might also use ?curve # same example as Bill's par(mar = c(5,4,2,4)+0.1, yaxs = "r") Sample <- rgamma(1000,2.5,.8) hist(Sample, main = "", freq = FALSE, ylim = c(0,1)) curve(pgamma(x, 2.5, 0.8), add=T, col='red') curve(dgamma(x, 2.5, 0.8), add=T, col='darkgreen') axis(4, col = "red") mtext(s

[R] error using lapply with oneway_test (coin package)

2009-05-07 Thread Matthieu Dubois
expr, envir, enclos) : object 'var' not found Thank you, Matthieu Matthieu Dubois Post-doctoral fellow Psychology and NeuroCognition Lab (CNRS UMR 5105) Université Pierre Mendès-France BP47 --- 38040 Grenoble Cedex 9 --- France Email: matthieu.dub...@upmf-grenoble.fr Gmail: mat

Re: [R] equation on graph

2009-04-27 Thread Matthieu Dubois
see ?plotmath and ?bquote HTH, Matthieu __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, repr

Re: [R] error bars in matplot

2009-04-16 Thread Matthieu Dubois
Hi Tim, there are a couple of problems in your example. (1) The most important is that your 'x' values for the matplot are 1:5 (that is row numbers of your mat1 matrix) and are seq(20,100,20) (that is, your vect vector) for your error bars. Error bars are thus plotted outside the plotting are

Re: [R] Display Equation on plot

2009-03-24 Thread Matthieu Dubois
Douglas M. Hultstrand metstat.com> writes: > > Hello, > > I am using the lm to fit a linear model to data, I was wondering if > there is a way to display the equation on a plot using the extracted lm > coefficients? I am using the plot() function to create the plot/.png. > > Example: > lm_m

Re: [R] How to color certain area under curve

2009-03-10 Thread Matthieu Dubois
Just a small typo. I forgot a ) in the polygon function. The code must be: polygon(x = c(qrv[1], drv$x[select], qrv[2]), y = c(0, drv$y[select], 0), col='blue') __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE

Re: [R] How to color certain area under curve

2009-03-10 Thread Matthieu Dubois
ucalgary.ca> writes: > > For a given random variable rv, for instance, rv = rnorm(1000), > I plot its density curve and calculate some quantiles: > plot(density(rv)) > P10P50P90 = = quantile(rv,probs = c(10,50,90)/100) > I would like to color the area between P10 and P90 and under the curve > a

Re: [R] Timing Portion of R Code

2008-12-17 Thread matthieu dubois
see ?system.time __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.

Re: [R] how to plot the histogram and the curve in the same graph

2008-10-21 Thread matthieu dubois
leo_wa hotmail.com> writes: > > > i want to plot the histogram and the curve in the same graph.if i have a set > of data ,i plot the histogram and also want to see what distribution it > was.So i want to plot the curve to know what distribution it like. You will find below an example using on