Displaying 2 results from an estimated 2 matches for "plotat".
2008 Oct 08
1
Lattice question: plotting two sets of data, defining groups for the second set
...former along with just points for the
latter in a single panel. The problem comes when trying to break out the
points by group. My sample code follows.
data1 <-
data.frame(Names=c(rep("Jon",9),rep("Karl",9)),Measurements=c(2,4,16,25,36,49,64,81,100,1,2,5,12,17,21,45,54,67),PlotAt=c(1:9,1:9))
data2 <-
data.frame(Names=c(rep("Jonah",9),rep("Beth",9)),Measurements=c(1:5,1,1,1,1,rep(20,9)),PlotAt=c(1:9,1:9))
Assume data1 looks good when smoothed and that data2 does not.
Plot the smoothed lines:
xyplot(
Measurements ~ PlotAt,
data = data1,
groups...
2008 Oct 10
3
predicting from a local regression and plotting in lattice
...m trying to (1) plot loess lines for each of my groupings using the same
color for each group; (2) plot loess predicted values.
The first part is easy:
data1 <-
data.frame(Names=c(rep("Jon",9),rep("Karl",9)),Measurements=c(2,4,16,25,36,49,64,81,100,1,2,5,12,17,21,45,54,67),PlotAt=c(1:9,1:9))
data2 <-
data.frame(Names=c(rep("Jonah",9),rep("Beth",9)),Measurements=c(1:5,1,1,1,1,rep(20,9)),PlotAt=c(1:9,1:9))
xyplot(Measurements ~ PlotAt, data = data1, groups=Names,
panel = function(...) {
panel.superpose(...,col="gray",lty=1,lwd=2);...