Displaying 20 results from an estimated 600 matches similar to: "Varying grid.rect in different panels of a Lattice plot"
2004 Sep 09
2
Skipping panels in Lattice
Dear all,
I wish to generate a lattice boxplot which skips an empty cell in a design.
I have trawled r-help, scruitinized xyplot(lattice) help page, and merrily
reproduced examples of using skip from a couple of previous r-help queries
and the example given in Pinheiro & Bates. But I must be missing something...
Here's an example (running R 1.9.1 on Win2k):
# generate some data
df1
2008 Jan 28
2
sub-plot in a plot
From: lamac_k em hotmail.comTo: r-help-request em r-project.orgSubject: sub-plot in a plotDate: Mon, 28 Jan 2008 15:43:40 +0000
Dear all, how can I do these sub-plots in a plot (see file attached) in R. Best regards.
Receba GR?TIS as mensagens do Messenger no seu celular quando voc? estiver offline. Conhe?a o MSN Mobile! Crie j? o seu!
2005 Jan 24
1
package dependency error on loading lme4
Hi all,
I recently (today) updated the Matrix package and installed the latticeExtra
package, but then when I tried to load the lme4 package, I got the following
error message:-
> library(lme4)
Loading required package: Matrix
Loading required package: latticeExtra
Error in importIntoEnv(impenv, impnames, ns, impvars) :
object(s) '.__C__lmeRep' are not exported by
2005 Mar 04
1
Rconsole wishlist
Hi all,
Wouldn't it be nice (??!!) if R automatically issued a warning message when
the R console buffer was about to fill so that you could save all your
output into a text file? (I know about sink(), but I think it would be good
to have an easier mechanism to save a complete record of messages and
function output). And on a similar vein, wouldn't it also be nice if R
automatically
2012 Mar 01
2
How to colorize the panel backgrounds of pairs()?
Dear expeRts,
I would like to colorize the backgrounds of a pairs plot according to the respective panel number. Here is what I tried (without success):
count <- 0
mypanel <- function(x, y, ...){
count <<- count+1
bg. <- if(count %in% c(1,4,9,12)) "#FDFF65" else NA
points(x, y, cex=0.5, bg=bg)
}
U <- matrix(runif(4*500), ncol=4)
pairs(U, panel=mypanel)
I
2010 Mar 05
4
conditioning variable in panel.xyplot?
I wish to create a multipanel plot (map) from several datasets ("d" and
"q" in the example below). I can condition the main xyplot statement on
the "site" variable, but I don't know how to pass a conditioning variable
to panel.xyplot plot so that the x-y coordinates from dataset q are only
plotted at the appropriate site.
library(lattice)
d <-
2008 May 30
1
Question about adding text to xYplot(Hmisc)
Hello,
I have been trying to make a graph that have error bars and text at
specific position.
I used the following code from the help file of xYplot(Hmisc) as an
example except I add a myPanel function, which is just supposed to add
letters from the alphabet at the position aligned at y = 3.
It constantly gives me error:
"Error using packet 1 argument "subscripts" is
2010 Jan 24
1
lattice ltext
Dear friends - please give me a hand.
I have a dataset of 40 patients in two groups observed on three
occasions. I only want to plot a line
for each patient in the two groups. I use the ltext function to put the
patient number but fail to make lattice understand the numbers as
unique since apparently it starts all over with 1:20 for each panel
instead of respecting my desires to have 1:20
2010 Apr 06
1
lattice package: line end style
First, apologies for no example data but I don't think it's needed in
this case,
Q: Can (and if so how ) the line end style be changed for 'cloud' plots?
I've tried par(lend=2), trellis.par.set(add.line = list(lend=2)) and
much googling but to no avail
Thanks in advance
Dan
P.S. the reason for this is that the round end looks bad at lwd=3 or
more
Daniel Alcock
Malaria
2011 Aug 20
1
Groups and bwplot
Dear R-users,
A while ago, Deepayan Sarkar suggested some code that uses the group
argument in bwplot to create some 'side-by-side' boxplots
(https://stat.ethz.ch/pipermail/r-help/2010-February/230065.html). The
example he gave was relatively specific and I wanted to generalize his
approach into a function. Unfortunately, I seem to have some issues
passing the correct arguments to the
2007 Oct 19
1
Using grid graphics (hexbin) in pairs() plot problem
Hi,
I am trying to create a plot with pairs()
using a gplot.hexbin() for each pair.
For pairs I can provide a custom upperPanel function:
pairs(iris[1:4], panel=mypanel)
and mypanel() calls plot.hexbin():
library(hexbin) # Bioconductor
mypanel <- function(x, ...){
hb <- hexbin(x)
plot(hb)
}
The problem is that gplot.hexbin() is based
on the
2011 Jan 21
1
Help for lattice. par(new=TRUE)
Hi list,
I want to plot two plot in the same figure. I set par(new=TRUE). But
it does not work.
library(lattice)
myPanel <- function(x,...)
{
panel.histogram(x,alpha=0.4,...)
ltext(0.4,1.5,paste("Mean=","0.05",digit=2)),cex=0.8)
ltext(0.8,1.5,paste("s.d.=","0.06",digit=2)),cex=0.8)
}
histogram(sh2,
2009 Nov 26
1
lattice --- different properties of lines corresponding to type=c("l", "a") respectively
I think the subject says it all. I want to make a simple lattice plot,
using xyplot with the
argument type=c("l","a").
The problem then is that in the resulting plot it is
difficult/impossible to see which plot corresponds to the average
and which to the individual profiles. I triedthings like extra
arguments lwd=c(1,3) or col=c("blue","red")
hoping
2008 Mar 27
1
panel function question
I have two data sets with locations, X, Y of houses (df.house) and
habitats(df.habitat), respectively. In each dataset, there are 3
replicates (Repeat). Because each replicate has different locations of
houses and habitats, I would like to plot them in panels. I wrote
something like this:
mypanel<-function(x,y,subscripts,...){
panel.xyplot(x,y,pch=20)
panel.xyplot(
2011 Sep 09
1
Adding groups to regression line panel function in Lattice
I wish to display a single-panel Lattice figure with grouped data and fitted regression lines. I don't seem to be able to get the
individual regression lines to display, e.g.;
d <- data.frame(q = rep(1:6, each=10), cc = rep(seq(10,100, 10),6)) # create data frame with group identifier 'q', independent variable cc
d$ba = d$q*0.1*d$cc + 5*rnorm(nrow(d))
2012 Mar 10
1
Use different panel functions with lattice
Hi,
I have a data.frame df with
names(df) = c("Var1", "Var2", "Var3", "Var4")
and I plot data with
xyplot(Var1+Var2~Var3|Var4, data=df)
I want to use different panel functions for Var1 and Var2.
How can I do ?
Something like :
panel.mypanel = function(x, y, ...) {
if (Var1) panel.Var1Panel(x, y, ...)
else panel.Var2Panel(x, y, ...)
}
2009 Mar 23
1
using xyplot
Dear R-sians!
I am trying generate a bunch of xyplots
library(lattice)
myPanel <- function(x,y,xl=range(x),yl=range(y),...) {
panel.xyplot(x,y, pch=20,col='blue',cex=0.7,xlim=xl,ylim=yl,...)
panel.abline(v=0, col='gray30',lty=2,lwd=1.5,...)
panel.loess(x,y,
span=2/3,family='gaussian',normalize=T,col='red',lwd=1.5,...)
#
2005 Aug 09
5
RGUI crash when opening script in XP Home enviroment
If there is a helpfile open (f.e ?glm) and it is the top window, then
an exception error occurs (closing RGUI)
when I hit the open file button.
If the helpfile is not the top window (of the RGUI) I am able to open a
new script without any error.
The RGUI is not closing complete there is a blank screen left which I
have to close with the X Button or Taskmanager
Windows XP Home - German Version
2010 Jan 15
1
Lattice: How to color the data points in splom() according to the panel they are plotted?
Dear ExpeRts,
I have the scatter plot matrix as given below. I would like the different "sub-plots" in the scatter plot matrix to be colored differently. How do I get all points shown in the upper-left plot (on position (1,1) in the scatter plot matrix) to be plotted in blue, and the points shown in the plot to the right (on position (1,2) in the scatter plot matrix) to be plotted in
2013 May 15
2
animating plots over time with a slider
I have a population of subjects each with a variable which has been captured at a baseline date. Then for many subjects (but not all) an intervention has occurred and the variable has changed at one or more time points after the baseline date. So my dataset consists of a subject ID (x), which may appear several times or just once, a measure (y), and a date of observation (z). I would like to be