Displaying 20 results from an estimated 2000 matches similar to: "lattice: showing panels for factor levels with no values"
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,
2010 Mar 22
2
using reorder in "dotplot"
Hi ,
Name
rate
HEALTHALLIANCE HOSPITALS, INC -1.06211747
MOUNT AUBURN HOSPITAL 0.50960291
STURDY MEMORIAL HOSPITAL 2.64233232
LAWRENCE GENERAL HOSPITAL 2.15628558
CAMBRIDGE HEALTH ALLIANCE 1.23623144
I would like use
2011 Jun 19
1
Accessor functions in lattice graphics
I know about the current.row, current.column, and panel.number functions that
are useful within panel functions written for lattice. Are there easy ways
to obtain the names of the conditioning variables (those appearing after |)
and their values for the current panel?
Thanks
Frank
-----
Frank Harrell
Department of Biostatistics, Vanderbilt University
--
View this message in context:
2009 Oct 13
1
Lattice barchart-reordered
Hi,Can I use "reorder" function with barchart as in dotchart? Here are some
codes which do not work for me. Thanks
Chetty
___________________________
a1c.cast$bmi.cat.reordered[a1c.cast$eth!="Other"]
<-with(a1c.cast[a1c.cast$eth!="Other",],reorder(bmi.cat.ordered[a1c.cast$eth!="Other"],
BP.FN.RATE,median ))
barchart(BP.FN.RATE~
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
2005 Mar 22
3
Lattice : factor levels in the margins
Hello !
I'm struggling again against lattice graprhics. ;) I'm trying to produce
a conditionnal xyplot with two conditionning factors (let's say A and
B). I want the levels of those factors (A1, A2, etc) to show in the
margins of the lattice plot, not in the strips between the panels.
A1 A2 A3
plot11 plot12 plot13 B1
plot21 plot22 plot23 B2
I managed to remove the
2005 Oct 27
2
RSQLite problems
Hi, I'm experimenting with using (R)SQLite to do data management. Here are
two little problems that I've encountered:
1. The presence of ',' in string values causes trouble since ',' is also the
delimiter used in the SQL statement.
2. A newline '\n' line attached to the last string value of each row.
Some examples:
> library (RSQLite)
Loading required
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 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,
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
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
2004 Jan 20
1
lattice: adding text between grouped panels?
How one can add a text (e.g. the labels of an axis)
in a space between grouped panels which was created
by using the argument ``between''?
Example:
data(barley)
dotplot(variety ~ yield | site * year, data=barley,
between=list(x=c( 0, 0, 6 ))
How to add labels for the y axis in the space in the middle?
Thanks
Wolfram
2004 Mar 04
1
lattice/grid: problem with viewports for strips with zero height
PROBLEM
# Allocating strip labels by the function strip.fun():
strip.test()
# Result: No strips: ok. No strings: NOT OK.
# The distance ``y.text=unit(6,"points")'' is ignored;
# the strings are not seen on the output.
TRIALS FOR WORKAROUNDS
strip.test( strip.lines=1 )
# Result: 2 strips: ok, but not whished. 2 strings: ok.
2012 Nov 15
1
strip.custom() with more than one conditioning variable
Suppose I wanted to plot the barley data like this:
dotplot(variety ~ yield | year+ site, barley,
strip = strip.custom(style = 4))
The factor levels are far too long for that to be useful. I can
overcome that problem if I shorten the levels like this:
dotplot(variety ~ yield | year + site, barley,
strip = strip.custom(style = 4,
factor.levels =
2006 Jul 07
2
dotplot (lattice) with panel.segments and groups
Hi,
The following produces almost exactly what I needed. The problems are
that the 'panel.dotplot' call (commented) generates the error 'Error in
NextMethod("[") : argument "subscripts" is missing, with no default'. The
other problem is that the colors alternate between the levels of the 'site'
variable, rather than 'year'.
barley$yield2
2018 Apr 27
1
[FORGED] Extracting specified pages from a lattice ("trellis") object.
Hi
Does this not do what you want ... ?
allpages <- dotplot(variety ~ yield | year * site, data=barley,
layout=c(2,2))
page2 <- allpages[1:2, 3:4]
print(page2)
Paul
On 24/04/18 17:51, Rolf Turner wrote:
>
> On 24/04/18 15:17, Paul Murrell wrote:
>
>> Hi
>>
>> I think the subsetting works by giving you the panels for the
>>
2018 Apr 24
0
[FORGED] Extracting specified pages from a lattice ("trellis") object.
On 24/04/18 15:17, Paul Murrell wrote:
> Hi
>
> I think the subsetting works by giving you the panels for the
> corresponding levels of the conditioning variable(s).? Note that, if
> there is more than one conditioning variable, you will need more than
> one subsetting index.
>
> For example, taking this plot with two conditioning variables and 12
> panels in
2009 Feb 19
2
dotplot points color
Dear list,
is it possible to change the background color of dotplot's points? I tried
in many ways but unsuccessfully
Thanks in advance
Gianandrea
require(lattice)
dotplot(variety ~ yield | site, data = barley, groups = year, pch=21)
dotplot(variety ~ yield | site, data = barley, groups = year, pch=21,
bg=c("2","3")) ??!!!
--
View this message in context:
2018 Apr 24
2
[FORGED] Extracting specified pages from a lattice ("trellis") object.
Hi
I think the subsetting works by giving you the panels for the
corresponding levels of the conditioning variable(s). Note that, if
there is more than one conditioning variable, you will need more than
one subsetting index.
For example, taking this plot with two conditioning variables and 12
panels in total ...
dotplot(variety ~ yield | year * site, data=barley)
... this produces three
2004 Sep 29
2
lattice .ps graphic is rotated in LaTeX slides
I've generated a version of the classic dotplot of the barley data with
library(lattice)
data(barley)
trellis.device("postscript", color=TRUE, file="barley2x3.ps")
old.settings <- trellis.par.get()
trellis.par.set("background", list(col = "white"))
lset(list(superpose.symbol=list(pch=c(19, 1, 25, 2, 15, 22, 23),