similar to: Fwd: Using panel.grid in barchart

Displaying 20 results from an estimated 9000 matches similar to: "Fwd: Using panel.grid in barchart"

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),
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
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 Jun 22
1
Grouped AND stacked bar charts possible in R?
Good day all, My statisticians want an R procedure that will produce grouped stacked barplots. Barplot will stack or group, but not both. The ftable function can produce a table of the exact form they want, but the barplot doesn't show all the divisions we want. For an example, here's the sample from the help file for "ftable:" data(Titanic) ftable(Titanic, row.vars = 1:3)
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
2011 Jan 26
1
barchart panel.text add label value and percent
Hello everybody, i need some help to display text as label in my barchart the label is the combination of x value + text text= calculated percentage => per it display properly the x value but, wrongly repeats the text of the fisrt level LangueTXT factor on the second any solution? Thanx very much Christophe ######## here is the code ########## library(lattice) Langue <- c(1, 1, 1, 2, 2,
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 12
1
Panel-specific colours in barchart, lattice package.
I would like, for possibly invalid reasons, to have the bars of the barchart in each panel to be the same colour, but with *different* colours from panel to panel. Can this be done? If so, how? I've read the help as much as I am capable of, and done an RSiteSearch () without becoming any wiser. Here's an example of what I'd like to do: X <- structure(list(y = c(2.8, 6.7,
2009 Jan 16
0
Barchart in lattice package: controlling order of bars in plot and color of a selected bar
Hi, I'm using the lattice function 'barchart' to make a series of 4 histograms. Currently, the y-axis values are graphed in order of the y-axis variable. I'd like to have the y-axis values sorted in ascending order of the x-axis values so that the longest bar horizontally is on top of the graph (in it's seciton) and the shortest bar is on the bottom. I can do this in
2006 Dec 08
1
missing factor levels in a lattice barchart panel cause unexpected failure
Hi all - I'm trying to generate lattice barchart graphs with missing values, and came across the following: This does not run. I would expect it to: library(lattice) D = data.frame(X=1, Y=factor(letters[2], letters[1:2])) barchart(~ X, D, groups=Y) Error in grid.Call.graphics("L_rect", x$x, x$y, x$width, x$height, resolveHJust(x$just, : invalid line type which is simply
2011 Feb 09
1
Adding labels into lattice's barchart
*** APOLOGIZES FOR THOSE READING THE LIST THROUGH NABBLE THIS WAS ALREADY POSTED THERE BUT NOT FORWARDED TO THE LIST FOR SOME UNKNOWN REASON *** I have a dataset that looks like: $ V1: factor with 4 levels $ V2: factor with 4 levels $ V3: factor with 2 levels $ V4: num (summing up to 100 within V3 levels) $ V5: num (nr of cases for each unique combination of V1*V2*V3 levels) Quite new to
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
2006 Oct 28
1
What determines the order of rows in a lattice barchart?
Hi, What determines the order of the rows in a barchart? Cheers, Geoff. Here is my code, and the data follows. If I have z in alpha order, the barchart is in some order I can't determine. I originally tried rownames(twater)~twater$Cat, but the chart wasn't in rownames(twater) order either. library(lattice) twater<-read.csv("totalwater.csv",strip.white=T)
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)),
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,
2002 Mar 27
0
Re: RE Vertical bars with barchart()
Hi, [I'mm cc-ing r-help on this, since some others might be interested (Tony Rossini is, at least)] Yes, I saw your mail and was wondering about what would be the best approach to do it. It's definitely not trivial, mainly because Trellis is not designed to handle factors on the x-axis (chiefly for convenience, as factors typically have long names which are difficult to write on the
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 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:
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),
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