Displaying 20 results from an estimated 10000 matches similar to: "more than one level of grouping in xyplot"
2010 Jun 02
2
building time series/zoo/its from a data frame
Dear R People:
I have the following data frame:
> x.df
date cond freq
1 04/01/09 Fever 12
2 04/02/09 Fever 11
3 04/03/09 Fever 10
4 04/04/09 Fever 13
5 04/05/09 Fever 6
6 04/01/09 Rash 6
7 04/02/09 Rash 10
8 04/03/09 Rash 9
9 04/04/09 Rash 10
10 04/05/09 Rash 8
11 04/01/09
2013 Feb 04
2
reshape help
Dear R users -
I have a list of patient identifiers and diagnoses from inpatient
admissions. I would like to reorganize the list, presently in a long
format to a wide format in reshape, but in the absence of a "time" element,
I am uncertain how to do this - any help greatly appreciated.
ID Dx
A nausea
A diabetes
A kidney failure
A heart attack
A fever
B fever
B
2005 Jul 25
1
order of panels in xyplot
I'm having trouble with the order of the panels using xyplot. I had used this bit of code before and received the desired plot (the code was not identical, but very similar; perhaps more importantly I was working with an older version of R) . Now the panels appear right to left instead of left to right, as it says in the help files, which is what I would like. Does anyone know if this has
2005 Feb 10
1
xyplot() question
Dear R Users,
I have an xyplot() where different plotting symbols are used for
subgroups (originally used within S-Plus, but hopefully it?s also
applicable to R users).
How can I fit separate regression lines for every subgroup? So far, I
can only plot the overall fitted line.
The code looks like this:
trellis.device()
sps<-trellis.par.get("superpose.symbol")
sps$pch<-1:7
2005 Sep 17
4
xyplot and abline
Dear All,
I wonderif there is a simple way to draw a regression line in the xyplot:
more specifically, let:
age <- c(20:30, 31:40 )
age.cut <- cut(age, breaks = 2 )
y<- rnorm(20)
x <- rnorm(20,4,1)
xyplot(y ~ x| age.cut, xlab="x", ylab="y")
How to draw (in the plot given by xyplot) the two regression lines (y ~ x) corresponding to the two category
2011 Feb 21
1
wrong lines in auto.key xyplot
Hi all,
I'm having a problem with the auto.key function in xyplot.
I changed the symbols an lines styles using these commands
trellis.par.set(superpose.symbol=list(pch=c(0,1,2,3,4,5,6,8,15,16)))
trellis.par.set(superpose.symbol=list(col=c(rep("black",11))))
trellis.par.set(superpose.symbol=list(cex=c(rep(0.6,11))))
2010 Apr 29
3
control span in panel.loess in xyplot
Dear R gurus..
Is it possible to control span settings for different values of a grouping
variable, when using xyplot? an example code shown below
d=data.frame(x=rep(sample(1:5,rep=F),10),y=rnorm(50),z=rep(sample(LETTERS[1:2],rep=F),25))
xyplot(y~x,data=d,groups=z,panel=panel.superpose,panel.groups=panel.loess(span=c(2/3,
3/4,1/2))
or something like..
2008 Jul 02
1
auto.key in xyplot in conjunction with panel.text
All,
I can't seem to get auto.key to work properly in an xyplot that is employing
panel.text. Specifically, I often change the default grouping colors then
use auto.key accordingly, but for some reason the same functionality isn't
working for this different type of plot. Any help much appreciated.
Cheers,
David
library("lattice")
dat = data.frame( Y = c(rnorm(18,1),
2009 Oct 25
1
different plot symbols in key using xyplot
I'm using xyplot in a very simple way---a scatter plot of several data
sets. I'm having a problem getting auto.key to display different
point characters.
The following produces a plot that employes different colors, all with
pch(1), for the different groups, with a matching key.
xyplot(Force~Time, rawData, groups=Sample, panel = panel.superpose,
auto.key=TRUE)
The following
2007 Mar 16
2
Discriminating between experiments with xyplot (lattice)
Hi,
suppose I have data from 3 experiments which show conversion as a function of
time for different boundary conditions, e.g. pressure, temperature. I want to
plot all experiments as conversion over time grouped according to the
temperature. However, since I have more than one experiment performed at the
same temperature (but different pressures) I end up figuring out which curve
belongs
2009 Jun 19
1
Adding site id to xyplot
Dear R Lists,
Can anyone help me add site IDs (site: 1~50) directly to my xyplot. I have 50 sites and collected observations from the sites at 13 different time points. I want to look at the change of my observations in each site. I was able to make a graph using xyplot, however, I can't find how to add site IDs within the graph not adding them in the legend. Overall, I would like to be able
2006 Aug 25
2
xyplot with different symbols and colors?
Dear List,
I try to make a xyplot with different colors and symbols, I came this far:
library(DAAG)
xyplot(csoa~it|sex*agegp,data=tinting,groups=target,pch=list(1,2),auto.key=list(space
= "right"))
this produces a plot with different colors and symbols but unfortunately
the legend does only follow the color scheme and not the different symbols.
Any suggestions what to change?
And
2010 Oct 09
1
point characters THICKER in xyplot()
Hi, how can I make the point characters thicker (NOT larger) in xyplot when
groups= argument is used?
dat<-data.frame(x=1:100,y=1:100,group=rep(LETTERS[1:5],each=20))
### lwd=2 doesn't work here
xyplot(y~x,groups=group,data=dat,col=1:4,pch=1:4,lwd=2)
### lwd=2 works with panel.points(), but grouping is messed up!
xyplot(y~x,groups=group,data=dat,col=1:4,pch=1:4,
2005 Mar 22
1
Question with lattice xyplot
Hi All,
I have a quick question and any help is greatly appreciated. For the following data when I try to produce the image using xyplot function in lattice package, the key has 4 rows instead of 2. Can anyone tell me what I'm doing wrong and what is the way to fix the problem. Here the code that I'm running
studyData <- as.data.frame(t(structure(c(
"A",0,4.477,
2011 Mar 07
1
XYPLOT - GROUPING WITH TWO CATEGORICAL VARIABLES
Hi! I have a dataframe like this:
dat=data.frame(Age=c(rep(30,8),rep(40,8),rep(50,8)),Period=rep(seq(2005,2008,1),3),Rate=c(seq(1,8,1),seq(9,16,1),seq(17,24,1)),Sex=rep(c(rep(0,4),rep(1,4)),3))attach(dat)dat
Age Period Rate Sex1 30 2005 1 02 30 2006 2 03 30 2007 3 04 30 2008 4 05 30 2005 5 16 30 2006 6 17 30 2007 7 18 30 2008
2009 Aug 01
2
xyplot: superpose 2 time series with different time intervals
I could use some advice regarding xyplot.
I've got 2 time series. Both cover approximately the same period of
time (ie, 1940 to 2009). But one series has annual data and the other
has monthly data. One refers to university enrollment; the other to
unemployment rates. Both are currently in the same data frame.
I'd like to use the monthly times series as a light grayscale
background for a
2009 Aug 05
4
multiple lty on same panel in xyplot
I would like to use lattice graphics to plot multiple functions (or groups
or subpopulations) on the same plot region, using different line types "lty"
or colors "col" to distinguish the functions (or groups).
In traditional graphics, this seems straightforward: First plot all the data
using 'type="n"', and subsequently execute a series of "points"
2006 Oct 05
2
xyplot
Hi,
for the data below:
time<-c(rep(1:10,5))
y<-time+rnorm(50,5,2)
subject<-c(rep('a',10),rep('b',10),rep('c',10),rep('d',10),rep('e',10))
group<-c(rep('A',30),rep('B',20))
df<-data.frame(subject,group,time,y)
I'd like to produce a plot with a single pannel with two loess curves one
for each group. the code below does
2007 Jul 17
2
xyplot for longitudinal data
Dear R-help subscribers,
I use xyplot to plot longitudinal data as follows:
score<-runif(100,-4,5)
group<-sample(1:4,100,rep=T)
subject<-rep(1:25,4)
age<-rep(runif(4,1,40),25)
df<-data.frame(score,group,age,subject)
xyplot(score~age|group, group=subject,
panel=function(...){
panel.loess(...,lwd=4)
panel.superpose(...)}
,data=df)
this produced a plot with four panels one for each
2004 Feb 05
2
xyplot (lattice): colours of lines
using either one of the following codes:
xyplot(X ~ time | center, type="l", panel=panel.superpose, groups=subject,
col = treatment)
xyplot(X ~ time | center, groups = subject,
panel = function(x, y, ...){
panel.superpose(x, y, col = treatment, type = "l", ...)
})
I get two different colours for the lines by these colours do not match the
corresponding
treatment