Displaying 20 results from an estimated 7000 matches similar to: "bwplot() {lattice}"
2009 Dec 08
3
re-ordering x-lables using barchart()
Hi R Users,
I'm trying to re-order the "site names" ("Waseca", "Morris", ...). I'm using
following code:
libarry(lattice)
barchart(yield ~ variety | site, data = barley,
groups = year, layout = c(6,1), aspect=.7,
ylab = "Barley Yield (bushels/acre)",
scales = list(x = list(abbreviate = TRUE, rot=45,
2006 Mar 21
5
How to use: library lattice: barchart
Dear ladies and gentlemen!
In the help text for the xyplot (library(lattice), help(xyplot)) is an example
given how one can use barchart:
barchart(yield ~ variety | site, data = barley,
groups = year, layout = c(1,6),
ylab = "Barley Yield (bushels/acre)",
scales = list(x = list(abbreviate = TRUE,
minlength = 5)))
2009 Dec 02
2
Help: barchart() {Lattice}
Hi R Users,
I'm using following data/code (data is attached also) to produce a stacked
barplot.
# Sample Data:
Names Col1 Col2 Col3
Row1 -20 40 -10
Row2 30 -20 40
Row3 30 10 -20
Row4 20 20 -10
# R Code:
dta<-read.table("data.txt", header=TRUE, row.names="Names")
barchart(data.matrix(dta),
horizontal=FALSE,
stack=TRUE,
par.settings = simpleTheme(col =
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,
2006 Mar 01
2
lattice-Internal
Hi,
The functions prepanel.default.bwplot() and lpretty() are not running in Deepayan's
barley example concerning vertical bars with the lattice function barchart().
Why, is there a restricted use for the package lattice-Internal?
Urs Simmen
mailto:usimmen at dtc.ch
2006 Mar 08
1
Trellis stacked bar legend
Dear R-Listers,
(well... called Depayan)
The standard example
barchart(yield ~ variety | site, data = barley,
groups = year, layout = c(1,6), stack = TRUE,
auto.key = list(points = FALSE, rectangles = TRUE, space = "right"),
ylab = "Barley Yield (bushels/acre)",
scales = list(x = list(rot = 45)))
shows the problem: legend colors are inverted compared to
2010 Mar 03
1
How to create a line and bar panel chart with two different axes?
I need to create a line and bar panel chart with two different axes. I tried
in lattice but couldn't get it worked. Here is my code:
data(barley)
barchart(yield ~ variety | site, data = barley,
groups = year, layout = c(1,6), stack = F,
auto.key = list(points = FALSE, rectangles = TRUE, space =
"right"),
ylab = "Barley Yield
2010 Jan 24
2
different x-axes in Lattice
I use lattice package and 'barchart' to build a chart. I have a
problem with setting different x-axes. Some x categories are missing
but they are display and I don't want. I use scales = list(y =
"free",x="free") but it works only for y-axes. Simple example:
package(lattice)
barchart(yield ~ variety | site, data = barley,
groups = year, layout = c(1,6),
2010 Apr 22
1
how to reorder of groups and specify ylim for each row in lattice barchart
R experts,
Is there anyway to reorder inside each group? In the following example, the
bar of year 1932 is always plotted before the bar of year 1931, may I change
the order inside each groups of bars?
library(lattice)
barchart(yield ~ variety | site,data=barley, groups = year, layout =
c(1,6),auto.key = list(points = FALSE, rectangles = TRUE, space =
"right"),ylab = "Barley Yield
2009 Sep 18
1
Lattice barplot not wokring in for-loop?
Dear List-Members,
I am plotting a barplot with the lattice package. The code works, but
when I execute the same code in a for-loop
no plot is shown. Can't figure what the problem is.
(Maybe I am missing something here, but I tried it with plot device
pdf, calling windows() or X11(), testing on windows and linux, etc.)
INFO: R version 2.9.1 (2009-06-26) using Windows/RGui
require(lattice)
2010 Jan 22
4
Rotating the axis labels in the basic graphic device ?
Hello dear R help group,
I learned recently that one can change the rotation of labels in the axis,
when using a lattice plot, for example:
library(lattice)
barchart(yield ~ variety , data = barley,
groups = year,
ylab = "Barley Yield (bushels/acre)",
scales = list(rot = 45))
My question is: Is there an application of "rot" in something like
2005 Mar 23
2
alternative to 'groups' for lattice bwplot()
Hi,
Is there some alternative to the 'groups' argument in lattice's bwplot
function for boxplots? Say in the example below:
bwplot(yield ~ site | year, data = barley)
you want to have two side by side boxplots per site, corresponding to each
year in the barley data frame. Ideally, the space between boxplots of the
same site should be smaller than that between boxplots of different
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 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 Dec 23
1
Borders for rectangles in lattice plot key
Hopefully an easy question. When drawing a rectangles in a lattice plot
key, how do you omit the black borders?
Here is an example adapted from one on the xyplot help page:
bar.cols <- c("red", "blue")
key.list <- list(
space="top",
rectangles=list(col=bar.cols),
text=list(c("foo", "bar"))
)
barchart(
yield ~ variety | site,
2006 Apr 14
1
Adding values to top of bars in barchart
Given the following data frame ("freq.sp"),
> str(freq.sp)
`data.frame': 42 obs. of 4 variables:
$ behav : Factor w/ 6 levels "approach","bowride",..: 1 1 1 1 1 1 1 2
2 2 ...
$ species: Factor w/ 7 levels "COAST_SPOT","EAST_SPINR",..: 1 2 3 4 5 6
7 1 2 3 ...
$ n : int 193 194 563 357 570 369 74 194 208 633 ...
$ pct :
2010 May 07
3
How to sort a grouped barchart?
Hi,
I have a barchart very similar to the example on the function documetation,
however, I want to sort the bars according one group in one panel.
Reminding:
library(lattice)
barchart(yield ~ variety | site, data = barley,
groups = year, layout = c(1,6),
ylab = "Barley Yield (bushels/acre)", auto.key=list(),
scales = list(x = list(abbreviate = TRUE,
2006 Dec 08
1
lattice: defining an own function using args for "formula" and "groups"
x.fun <- function( formula, data ) dotplot( formula, data )
x.grp <- function( formula, groups, data ) dotplot( formula, groups, data )
data( barley )
> x.fun( variety ~ yield | site, data=barley )
# no problem
> dotplot( variety ~ yield | site, groups=year, data=barley )
# no problem
> x.grp( variety ~ yield | site, groups=year, data=barley )
object "year" not found
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,
2006 Feb 08
1
bwplot: how to display response variables separately in same panel?
Hi -
I have two response variables 'y1' and 'y2' and a factor 'x'. I would like
to create paired box-whiskers plots for y1~x and y2~x and labeled for the
same x. the b-w plots would be side-by-side in the same panel - almost like
a barchart with two parallel columns for the same x.
the code 'bwplot(y1+y2~x, outer=T)' gives me two side-by-side panels. this
is ok,