Skip to content
Back to formatted view

Raw Message

Message-ID: <52AB473A.6060600@gmail.com>
Date: 2013-12-13T17:43:22Z
From: peyman
Subject: data point labeling in xyplot

Hi Folks,

I have data with a format like:

ID    y    param1    param2    groupingFactor1    groupingFactor2.....
1    ...   
1
1
1
2
2
2
2
3
3
3

so several grouping factors and repeated measures. I am using trellis
and xyplot to get plot with several grouping factors.
something like xyplot(y~x|grouping1*grouping2, data=na.omit(mydata),
panel=function{panel.xyplot(x,y);....}); Lets say x is the x axis
parameter and y the one for y.
So this will produce a plot with 4 windows which groups data according
to all combinations of groupingFactor1 and groupingFactor2.

Now I want to label the data points in each of these four plot windows
with the "ID" (ID is an integer representing the subject number). I used
the ltext(x=x,y=y,...), but then it uses the superscripts for the all
data set and dose not mark the data correctly. It only works if I ignore
the grouping and have all my data in one single plot window. It seems
that I should somehow pass the correct subscripts for the data in each
plot window (or group), but I could not figure it out.

thanks,