similar to: ggplot2: changing default colors of boxplot

Displaying 20 results from an estimated 9000 matches similar to: "ggplot2: changing default colors of boxplot"

2010 Jun 18
1
ggplot2 boxplot: horizontal, univariate
In ggplot2, I would like to make a boxplot that has the following properties: (1) Contrary to default, the meaningful axis should be the horizontal axis. Lattice does this, for instance, by library(lattice);bwplot(~mtcars$mpg) (2) It is *univariate*, i.e., of a single vector, say mtcars$mpg. I do not wish to make separate plots for the different values of mtcars$cyl. (3) Nothing on the
2012 Jul 01
4
geom_boxplot
Also, it is possible to change "ylim" also? 2012/7/1 li li <hannah.hlx@gmail.com> > Dear all, > I have a few questions regarding the boxplot output from the > "geom_boxplot" function. > Attached is the output I get. Below are my questions: > > 1. How can I define the xlab and ylab myself? > Also I would like to remove
2011 Sep 26
2
Boxplot BUT with Mean, SD, Max & Min ?
People, It appears that there is no way of getting Boxplots to plot using Mean, SD, Max & Min - is there something else that would do what I want? I couldn't find it . . Thanks, Phil. -- Philip Rhoades GPO Box 3411 Sydney NSW 2001 Australia E-mail: phil at pricom.com.au
2010 Mar 24
1
GGPLOT2: Reverse order of legend to match order of x-axis
How do I reverse the order of the legend in a bar plot to match order of the x-axis? In other words, I want the stacked colors of the legend to match the stacked colors of the bar plot. I tried this, but it didn't work. colors <- c("5" = "red","4" = "blue","3" = "darkgreen") p <- qplot(factor(cyl), data=mtcars,
2008 Oct 21
1
GGPLOT/QPLOT Boxplot with summary
I'd like to generate a boxplot that has BOTH the overall distribution of a continuous variable (say age), and then a boxplot for each level of a stratifying variable (e.g. site). Does anyone have prototype code for this? Thanks, -- View this message in context: http://www.nabble.com/GGPLOT-QPLOT-Boxplot-with-summary-tp20095591p20095591.html Sent from the R help mailing list archive at
2007 Oct 01
4
how to plot a graph with different pch
I am trying to plot a graph but the points on the graph should be different symbols and colors. It should represent what is in the legend. I tried using the points command but this does not work. Is there another command in R that would allow me to use different symbols and colors for the points? Thank you kindly. data(mtcars) plot(mtcars$wt,mtcars$mpg,xlab= "Weight(lbs/1000)",
2012 Mar 15
2
Ggplot barchart drops factor levels: how to show them with zero counts?
Hello, When plotting a barchart with ggplot it drops the levels of the factor for which no counts are available. For example: library(ggplot) mtcars$cyl<-factor(mtcars$cyl) ggplot(mtcars[!mtcars$cyl==4,], aes(cyl))+geom_bar() levels(mtcars[!mtcars$cyl==4,]) This shows my problem. Because no counts are available for factorlevel '4', the label 4 dissapears from the plot. However, I
2010 Aug 04
3
retrieve name of an object?
Dear all Is there an easier way to retrieve the name of an object? For example, > tmp <- 1:10 > as.character(quote(tmp)) [1] "tmp" > as.character(quote(mtcars$cyl)) [1] "$" "mtcars" "cyl" > as.character(quote(mtcars$cyl))[3] [1] "cyl" The last call more than anything seems a hack. Is there a better way? Thank you Liviu
2013 Apr 17
2
remove higher order interaction terms
Dear all, Consider the model below: > x <- lm(mpg ~ cyl * disp * hp * drat, mtcars) > summary(x) Call: lm(formula = mpg ~ cyl * disp * hp * drat, data = mtcars) Residuals: Min 1Q Median 3Q Max -3.5725 -0.6603 0.0108 1.1017 2.6956 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 1.070e+03 3.856e+02 2.776 0.01350 * cyl
2020 Apr 16
2
suggestion: "." in [lsv]apply()
I'm sure this exists elsewhere, but, as a trade-off, could you achieve what you want with a separate helper function F(expr) that constructs the function you want to pass to [lsv]apply()? Something that would allow you to write: sapply(split(mtcars, mtcars$cyl), F(summary(lm(mpg ~ wt,.))$r.squared)) Such an F() function would apply elsewhere too. /Henrik On Thu, Apr 16, 2020 at 9:30 AM
2020 Apr 16
6
suggestion: "." in [lsv]apply()
Hi, I would like to make a suggestion for a small syntactic modification of FUN argument in the family of functions [lsv]apply(). The idea is to allow one-liner expressions without typing "function(item) {...}" to surround them. The argument to the anonymous function is simply referred as ".". Let take an example. With this new feature, the following call
2020 Apr 16
2
suggestion: "." in [lsv]apply()
Simon, Thanks for replying. In what follows I won't try to argue (I understood that you find this a bad idea) but I would like to make clearer some of your point for me (and may be for others). Le 16/04/2020 ? 16:48, Simon Urbanek a ?crit?: > Serguei, >> On 17/04/2020, at 2:24 AM, Sokol Serguei <sokol at insa-toulouse.fr> >> wrote: Hi, I would like to make a
2009 Oct 13
2
multiple groups with different colors in boxplot
Can anybody help me on how to boxplot multiple groups with different color? Say, I have 3 groups of data, each group with 2 boxes, and I'd like to have the following layout in the boxplot: red, red, green, green, blue, blue thanks in advance. -- View this message in context: http://www.nabble.com/multiple-groups-with-different-colors-in-boxplot-tp25867267p25867267.html Sent from the R help
2020 Apr 20
1
suggestion: "." in [lsv]apply()
Le 19/04/2020 ? 20:46, Gabor Grothendieck a ?crit?: > You can get pretty close to that already using fn$ in the gsubfn package: >> library(gsubfn) fn$sapply(split(mtcars, mtcars$cyl), x ~ >> summary(lm(mpg ~ wt, x))$r.squared) > 4 6 8 0.5086326 0.4645102 0.4229655 Right, I thought about similar syntax but this implementation has similar flaws pointed by Simon, i.e. it reduces
2020 Apr 17
2
suggestion: "." in [lsv]apply()
Thanks Simon, Now, I see better your argument. Le 16/04/2020 ? 22:48, Simon Urbanek a ?crit?: > ... I'm not arguing against the principle, I'm arguing about your > particular proposal as it is inconsistent and not general. This sounds promising for me. May be in a (new?) future, R core will come with a correct proposal for this principle? Meanwhile, to avoid substitute(),
2009 Feb 26
1
bottom legends in ggplot2 ?
Has anyone had success with producing legends to a qplot graph such that the legend is placed on the bottom, under the abcissa rather than to the right hand side ? The following doesn't move the legend: library(ggplot2) qplot(mpg, wt, data=mtcars, colour=cyl, gpar(legend.position="bottom") ) I am using ggplot2_0.8.2. Thanks in advance, Avram
2010 Nov 30
3
pca analysis: extract rotated scores?
Dear all I'm unable to find an example of extracting the rotated scores of a principal components analysis. I can do this easily for the un-rotated version. data(mtcars) .PC <- princomp(~am+carb+cyl+disp+drat+gear+hp+mpg, cor=TRUE, data=mtcars) unclass(loadings(.PC)) # component loadings summary(.PC) # proportions of variance mtcars$PC1 <- .PC$scores[,1] # extract un-rotated scores of
2015 Jun 16
4
Ayuda boxplot ggplot2
Hola a todos Me gustaría saber si me pueden ayudar con lo siguiente. Realicé un Boxplot usando ggplot2 para visualizar el comportamiento de dos variables. Visualmente no se notan las diferencias porque la gráfica de la derecha (parásitos en el abdomen) llega hasta 20 en el eje y. ¿Cómo puedo hacer para que las dos gráficas muestren la misma escala en el eje Y, es decir, que las dos lleguen a 60?
2009 Jan 11
2
connecting boxplots
Hii, I created some boxplots with this commands: x <-read.table(file="test.txt") x$group <- rep(1:8, each=5) boxplot(V3~gruppe, data=x) Now, I will connect the boxplots to each other to the min, max and median values. Can anybody help me how to do it ? greetings, J -- View this message in context: http://www.nabble.com/connecting-boxplots-tp21405459p21405459.html Sent from
2009 Jan 07
1
Problem with ggplot2 - facet_wrap and boxplot
Hello R users and Hadley, Back again with a little problem in ggplot2 =o) (ggplot 0.8.1, R 2.8.0) Here the problem : library(ggplot2) df <- data.frame(id = 1:100, x1 = c(rnorm(50), rnorm(50, 1)), x2 = c(rnorm(50), rnorm(50, 1.5)), x3 = c(rnorm(50, 0.5), rnorm(50, 2.5)), group = as.factor(rep(c("a", "b"), each = 50))) df.melt <- melt(df, id = c("id",