similar to: What determines the order of rows in a lattice barchart?

Displaying 20 results from an estimated 2000 matches similar to: "What determines the order of rows in a lattice barchart?"

2013 Feb 26
1
Getting the correct factor level as Dunnett control in glht()
Hello all, I would like to do a Dunnett test in glht(). However, the factor level I want to use as the control is not the first. dunn1<-glht(model3, linfct = mcp(Container = "Dunnett"), alternative = "less") The factor container has 8 levels, so it would be nice not to manually enter in all of the contrasts. I originally discovered glht() when working with a glm model
2003 May 08
2
border of bars in lattice barchart
Hello! How to change a color (or linewidth) of border in lattice 'barchart'? I am trying barchart( (......) - my arguments panel=function(x,y,color,subscripts,groups,...) { panel.barchart(x=x,y=y,box.ratio=2,col=color,border=FALSE) })) or ... panel.barchart(x=x,y=y,box.ratio=2,col=color,border='transparent') ... or
2009 Feb 08
2
Using panel.grid in barchart
Hi all, I'm trying to do an example in Deepayan Sarkar's Lattice book. It involves making a barchart based on the Titanic dataset. I can get the barchart to plot fine; however, when I try to edit panel.grid, I get an error: > titan<-barchart(Class ~ Freq | Age + Sex, data = as.data.frame(Titanic), groups=Survived, stack=TRUE, layout=c(4,1),
2008 Sep 16
2
Setting user colors in barchart
Dear R Users, I have a basis question regarding the use of color in the lattice package. I read the ?barchart help page and searched the R archives but could not understand how to do it. I just need to plot a barchart using specific colors for my groups, e.g. green and red instead of the default lattice colors. How do I do that? If I say: barchart(x ~ a_factor, groups=my_groups,
2003 Nov 02
3
barchart in lattice
Dear all, I have two factors 'country' and 'status' which I would like to plot via barchart (lattice). 'status' consist of three different levels and should be the grouping variable, i.e. there should be drawn three different panels and within each panel a barchart of 'country'. barchart(daten$COUNTRY|daten$STATUS),
2010 Feb 05
2
lattice barchart using a time scale in x axis
I'm trying to produce a barchart plot with groups, in which each group is placed in a particular time scale in x-axis. If I use barchart directly it does not take the time scale. I've tried with xyplot and adding a panel.barchart, I have the bars in the right place, but not the three groups I'm trying to produce. I've tried defining panel and panel.group, but can't get it to
2010 Nov 30
2
Error bars in lattice barchart with groups
Dear R-users, i want to plot gene regulation data in a lattice barchart. To illustrate the problem i encounter, the following code uses the "barley"dataset: library(lattice) barley[["SD"]] <- 5 PLOT <- barchart(data=barley, yield~variety|site, groups=year,origin=0, as.table=TRUE, scales=list(x=list(relation="same", rot=30), y=list(alternating=3,tck=-1)),
2009 Oct 12
1
Loading data to Trellis barchart plot.
Dear all, I have a question about loading the data to barchart plot. I know this could be a very easy question, but I just can not get my head around. What I need to do is to create a trellis plots barchart style (horizontal bar), with levels of one variable (ie. variable “colour” in my example) as ylab and frequency as xlab on each trellis plot. The trellis plots is separated based on
2007 Jul 10
1
Lattice: vertical barchart
barchart(Titanic, stack=F) produces a very nice horizontal barchart. Each panel has four groups of two bars. barchart(Titanic, stack=F, horizontal=F) doesn't produce the results I would have expected, as it produces this warning message: Warning message: y should be numeric in: bwplot.formula(x = as.formula(form), data = list(Class = c(1, And it results in each panel having 22 groups of
2010 Apr 03
2
Export bug? Hist() vs. barchart().
Hi, If you want to export a single bar chart, this works: > png( "ET" ); > barchart( data[,"ET"] ) > dev.off() quartz_off_screen 2 But if you want to export a few of them, this does not: > factorCols <- c("MR","ET"); > sapply( factorCols, function(x) { + png( x ); + barchart( data[, x] ); + dev.off(); + } );
2010 Jan 20
3
barchart with stacked and beside bars
Hi, Is there a way to stack bars in a barchart as well as "beside" bars for the same treatment? eg.... I have one barchart like this: bio<-matrix(c(10,23,9,25),nrow=2,byrow=T) ntreat<-c("n0","n96") colnames(bio)<-ntreat barplot(bio,beside=T) now i want a similar barchart but with stacked bars:
2006 Jan 25
2
panel function with barchart (lattice)
Folks at R help, I can't quite get the panel function to work the way I want within barchart. I guess I'm still not understanding how to piece together multiple panel arguments, especially when "groups" is specified. Example: I want to be able to add the value of "yield" to each section of each bar in this graph: barchart(yield ~ variety | site, data = barley,
2008 Jun 26
1
Gettting barchart titles as numbers not characters
Hi, I wonder if you could help me with my barcharts, I am using the barchart function from the lattice library. I have data like this: Complex,Organisms,Percentage 130,0,50 130,1,10 130,2,20 130,3,15 130,4,5 133,0,10 133,1,15 133,2,20 133,3,50 133,4,5 I draw barcharts using this command...
2007 Jun 22
1
Barchart legend position
I am using barchart to make charts for some data with a lot more functions and labels and such in the command. barchart(Freq ~ factor(HH), data = dataset1, group= year) So I have my data grouped by year and I get a legend at the top of graph, which is great cause I need the legend for the different years but it is a weird spot. So how can I manipulate the legend, ie. Move it, shrink it, do
2004 Feb 10
3
confidence-intervals in barchart
Hi R users, 1) How does one show confidence-intervals in a barchart and use rownames for labels on the y-axes? I have looked at "plotCI" in "gregmisc" package . But it does not seem to produce something like a barchart. The statistic, error, upper-bound, and lower-bound are in a dataframe. 2) How to show CI in a barchart either using the statistic and, either (a)
2005 Jun 25
1
Confidence interval bars on Lattice barchart with groups
I am trying to add confidence (error) bars to lattice barcharts (and dotplots, and xyplots). I found this helpful message from Deepayan Sarkar and based teh code below on it: http://finzi.psych.upenn.edu/R/Rhelp02a/archive/50299.html However, I can't get it to work with groups, as illustrated. I am sure I am missing something elementary, but I am unsure what. Using R 2.1.1 on various
2006 Aug 14
1
Lattice barchart with different fill pattern
Dear list, I am new to lattice plots. I want to make a barchart with 10 and more levels. I need to use a grey scale for printing purposes. The problem is that with 10 or more levels in factors it is very difficult to distinguish each level in the plot and legend, since the greys are very similar (some levels have value of zero and don't appear). Here is an example of my problem: df <-
2007 Dec 19
1
Different labels by panel in barchart
Dear all, I'm analysing a survey, and creating a barchart of the different responses for each question. The questions are grouped according to a number of categories, so I'm using lattice to create a plot with each question in a category on it. The problem is that the response set for different questions within the same category varies. I want to be able to draw only the relevant
2009 Mar 29
1
Two variables on one lattice barchart
Hi, I created the barchart below using the lattice package, however I can't seem to find a way to add another variable as a line (see the desired square/lines that I drew for the last 10 years of the plot). Can anyone help me with this? Your help is much appreciated! Code: Schart<-barchart(Catch~Year,data=SNA, scales=list(col = "black", tck = c(1, 0),x=list(rot=45)))
2007 Feb 24
2
barchart (lattice) with text labels
I would like to place the value for each bar in barchart (lattice) at the top of each bar. Something like the following code produces. library(lattice) mypanelfunc <- function(x, y, ...) { panel.barchart(x, y, ...) panel.text(x, y, labels=as.character(round(x,2)), ...) } myprepanelfunc <- function(x, y, ...) list(xlim=c(0, max(x)+.1)) mydata <- expand.grid(a=factor(1:5),