similar to: Size of the legend

Displaying 20 results from an estimated 30000 matches similar to: "Size of the legend"

2010 Sep 03
7
Function Gini or Ineq
Hi listers, Does it necessary to install any package in order to use the GINI or INEQ functions. If I use the following command the R tells me that didn't find the GINI function. x<-c(541, 1463, 2445, 3438, 4437, 5401, 6392, 8304, 11904, 22261) G<-gini(x) Thanks in advance, Marcio -- View this message in context:
2009 Jun 11
4
Count observation
Hi listers, I have the following code... data<-as.matrix(c(1,2,3,4,5,6,7,8,9,10),nrow=10,ncol=1,byrow=TRUE) n<-nrow(data) m<-n-1 boot<-data[sample(m,replace=T),] So, I need to count the number of times each observation was selected at the sample with replacement... Suppose I sampled... 4 5 1 3 7 5 1 4 7 So, I would count... x count 1 2 2 0 3 1 4 2 5 2 6 0 7 2 8 0 9 0 10 0
2010 Sep 14
4
If then else with command for
Hey listers, I am trying to do something simple... Check the program below... I would like to create a variable named COLOR according to the conditions that I stablished... But the problem is that it seems that my variable COLOR is checking just on sample, may be last in the loop... Certainly, I am missing something... Thanks in advance, Marcio
2009 Sep 18
2
Sum according observation
Hi listers, I have a simple doubt... I need to manipulate the data base as: var1 var2 7 0.1 7 0.1 8 0.12 10 0.15 12 0.18 20 0.31 I would like to aggregate the equal cases as var1 making the sum of var2... I would get... var1 var2 7 0.2 8 0.12 10 0.15 12 0.18 20 0.31 Thanks in advance, Marcio -- View this message in context:
2010 Jun 07
1
Patch for legend.position={left,top,bottom} in ggplot2
Hi Hadley and everyone, here's a patch for ggplot2 that fixes the behavior of opts(legend.position={left,top,bottom}). If you try the following code in an unmodified ggplot2 options(warn = -1) suppressPackageStartupMessages(library("ggplot2")) data <- data.frame( x = c(1, 2, 3, 4, 5, 6), y = c(2, 3, 4, 3, 4, 5), colour = c(TRUE, TRUE, TRUE, FALSE, FALSE, FALSE))
2010 Feb 25
1
read.table (trying one more time)
Hey listers, I've posted this doubt other day... But I am still having a hard time... I have a MAC and I am not getting how to use the read.table command... At the bottom of the FINDER application I have the following path: Macintosh HD>Usu?rios>User>Marcio>UdeM>Travail Dirig?>Data>MU284 Population.txt I didn't find out how I could copy and paste this path as it is
2009 Jun 12
3
Order data frame
Hi listers, I have a data frame with 5 variables... And I want reorder the data frame according a specific variable X... I checked the sort and order functions... In my case I think that the ORDER function is applicable... But I did not understand at all... The idea is simple... Data order by X... I know that this is very simple... Anyways... How I would do that... Thanks in advance, Marcio --
2009 Aug 19
2
ggplot2 legend problem
I'm trying to overlay two histograms using transparency to enable viewing of multiple distributions on a single scale. So far ggplot2 seems to do what I want. However I'm having a problem generating the legend coloring appropriate to each distribution in the plot. Here is a test case to show my best (failed) effort so far: library(ggplot2) x <- data.frame(X=rnorm(1000, mean=0)) y
2011 Nov 15
1
grid.arrange, grid.layout - legend, global y axis title
Hello, I created several plot with ggplot2 dev mode. Now I want to combine the plots in a grid e.g. 2x2 with a fixed size of the output. What I am doing at the moment is: grid.newpage() pushViewport(viewport(layout = grid.layout(nrow=2, ncol=2, widths = unit(c(7.5,6.5), "cm"), heights = unit(rep(5, 2), "cm")))) print(plot1, vp = viewport(layout.pos.row = 1,
2009 Dec 11
1
ggplot: Problem with legend background
Dear R-users, I am preparing graphs for an upcoming article using the different functions of the ggplot2 package and I've been having problems with the legend background. It doesn't seem to scale when the text size is increased. Here's the mandatory reproducible example: library(ggplot2) repFrame <- data.frame(A= 1:10, B= rnorm(1:10), groupNum = rep(c("First group",
2011 Aug 29
1
Legend / bar order - ggplot2
Hi all, I am trying to do a barplot in ggplot2 and want to make sure that the legend order is consistent with the bar order, that is the legend order is orig and match; and the bars are ordered in the same way. It seems to me that I can only control one of them. Any idea? library(ggplot2) df <- data.frame(value = rnorm(20), name = factor(rep(letters[1:10], 2), levels =
2012 Jul 03
2
ggplot2: legend
Dear all, I produced the following graph with ggplot which is almost fine, yet I don't like that the legend for "Means" and "Observations" includes a line, though no line is used in the plot for those two (the line for "Overall Mean" on the other hand is wanted): library(ggplot2) ddf <- data.frame(x = factor(rep(LETTERS[1:2], 5)), y = rnorm(10)) p <-
2007 Sep 03
1
Legend issue with ggplot2
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)) dummy$y <- dummy$x * rnorm(4)[dummy$group] + 5 * rnorm(4)[dummy$group] dummy$min <- dummy$y - 5 dummy$max <- dummy$y + 5 ggplot(data
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,
2012 Jun 06
2
ggplot2: legend for geom_rug() ..?
Hi, I was trying to make another legend for the rug plot. Sample code: library(ggplo2) ids <- paste('id_',1:3,sep='') before <- sample(9) after <- sample(1:10,9) dat <- as.matrix(cbind(before,after)) rownames(dat) <- rep(ids,3) position <- c(rep(10,3),rep(13,3),rep(19,3)) mdat <- cbind(melt(dat),position) ggplot(mdat, aes(position, value)) +
2011 Feb 04
1
Can an xyplot() plus legend be saved as an Enhanced Windows Metafile (EMF)?
I am trying to save some graphical output including a legend in the Windows Enhanced Metafile (EMF) format. This fails when xyplot() is used rather than plot(). Here is a simple example: require(lattice) a <- c(1:10) b <- c(2,4,5,2,3,5,7,8,9,5) # Output can be saved (or copied to the clipboard) as a Windows EMF image file # from the Graphics Device output window. plot(a , b)
2012 Feb 10
5
how to plot a nice legend?
i'd like to plot a legend in my diagram. The diagram will be included in a TikZ LaTeX document later. I tried the legend() function, but - it can not find a good place it self where the legend fits and playing around with coordinates and scaling consumes a lot time - standard settings for the text need adjustment (linespacing is quite large and so on) Is there an alternative to
2009 Dec 01
1
ggplot legend for multiple time series
Hello All, I am trying to create a legend for a black-white graph. The package I use is ggplot2. It can add colors to the legend key but not line types. Can you please help? # example from Wickman (2009, ggplot2 - elegant graphics for data analysis, page 109) library(ggplot2) huron <- data.frame(year=1875:1972, level=LakeHuron) ggplot(huron, aes(year)) +
2010 Oct 20
1
Adding Legend about two quantile lines at ggplot
Hi, all. I'd like to add legend on my graph but I can't. My code is follows. library(ggplot2) score1<-rnorm(100,0,5) score2<-rnorm(400,10,15) mydata<-data.frame(score1,score2) ggplot(mydata,aes(y=score2,x=score1))+geom_point()+stat_quantile(quantiles=c(0.50),col="red")+stat_quantile(quantiles=c(0.90),col="blue",size=2) I like to add legend indicating the
2013 Sep 26
1
Less than equal to symbol in ggplot2 legend text
Hello, I am trying to add a less than equal to symbol in a ggplot2 legend text. See sample code below. I have tried using the expression function and \u2264. I also tried adding labels to legend.text under theme. Neither of these 3 options work. Please help, Mahesh ++++++++++++++ Extra.column=ifelse(data[,covariate]>cutpoint,1,0) Grp1 <- "\u2264 1.5" Grp2 <-