Gabor Grothendieck a écrit :
> Try this version which corresponds to your latest version
> but makes use of panel.groups distinguishing the groups
> using group.number:
>
> # set custom col and pch here
> my.col <- 1:nlevels(df$f2)
> my.pch <- 1:nlevels(df$f1)
>
> pnl <- function(x, y, subscripts,
Try this version which corresponds to your latest version
but makes use of panel.groups distinguishing the groups
using group.number:
# set custom col and pch here
my.col <- 1:nlevels(df$f2)
my.pch <- 1:nlevels(df$f1)
pnl <- function(x, y, subscripts, pch, group.number, ...) {
panel <- c(panel.
Gabor Grothendieck a écrit :
> In thinking about this a bit more we can use
> panel.superpose/panel.groups to shorten it:
>
> # define data -- df
>
> # note that your val2 and val3 lines had a syntax
> # so we have commented them out and
> # replaced them as shown.
> n <- 18
> x1 <- seq(1,n)
> val
In thinking about this a bit more we can use
panel.superpose/panel.groups to shorten it:
# define data -- df
# note that your val2 and val3 lines had a syntax
# so we have commented them out and
# replaced them as shown.
n <- 18
x1 <- seq(1,n)
val1 <- -2*x1+50
# val2 <- (-2*(x1-8)2)+100
val2 <- (
Or maybe this is what you are looking for where pnl below was
created by modifying source to the panel.plot.default in the zoo
package (there might be a simpler way):
pnl <- function (x, y, subscripts, groups, col, pch, type, ...) {
for (g in levels(groups)) {
idx <- g == groups[subsc
To handle conditioning on survey we provide a panel function
that subsets col and pch:
# define test data - df
# note that your val2 and val3 lines had a syntax
# so we have commented them out and
# replaced them as shown.
n <- 18
x1 <- seq(1,n)
val1 <- -2*x1+50
# val2 <- (-2*(x1-8)2)+100
val2 <-
> In fact, my problem is to fit the data for every level of the f2 factor,
> showing the levels of the f1 factor and that for several surveys .
> Here's an example closer to my actual data :
Then maybe you want:
qplot(x, y, . ~ surveys, data=df, type="line", colour=f1, id=f2, size=f2)
(which does
Gabor Grothendieck a écrit :
>Note that before entering this you need:
>
>library(lattice)
>library(grid) # to access the viewport function
>
>On 8/29/06, Gabor Grothendieck <[EMAIL PROTECTED]> wrote:
>
>
>>Try this:
>>
>>xyplot(val ~ x, data = df, type = "p",
>> col = as.numeric(df$f1), p
Gabor Grothendieck a écrit :
> Try this:
>
> xyplot(val ~ x, data = df, type = "p",
> col = as.numeric(df$f1), pch = as.numeric(df$f2))
>
> key1 <- list(border = TRUE, colums = 2, text = list(levels(df$f1)),
> points = list(pch = 1:nlevels(df$f1))
> )
>
> key2 <- list(border = TRUE, colums
hadley wickham a écrit :
>> I would like to use the lattice library to show several groups on
>> the same graph. Here's my example :
>>
>> ## the data
>> f1 <- factor(c("mod1","mod2","mod3"),levels=c("mod1","mod2","mod3"))
>> f1 <- rep(f1,3)
>> f2 <- factor(rep(c("g1","g2","g3"),each=3),level
Note that before entering this you need:
library(lattice)
library(grid) # to access the viewport function
On 8/29/06, Gabor Grothendieck <[EMAIL PROTECTED]> wrote:
> Try this:
>
> xyplot(val ~ x, data = df, type = "p",
>col = as.numeric(df$f1), pch = as.numeric(df$f2))
>
> key1 <- list(bo
Try this:
xyplot(val ~ x, data = df, type = "p",
col = as.numeric(df$f1), pch = as.numeric(df$f2))
key1 <- list(border = TRUE, colums = 2, text = list(levels(df$f1)),
points = list(pch = 1:nlevels(df$f1))
)
key2 <- list(border = TRUE, colums = 2, text = list(levels(df$f2)),
> I would like to use the lattice library to show several groups on
> the same graph. Here's my example :
>
> ## the data
> f1 <- factor(c("mod1","mod2","mod3"),levels=c("mod1","mod2","mod3"))
> f1 <- rep(f1,3)
> f2 <- factor(rep(c("g1","g2","g3"),each=3),levels=c("g1","g2","g3"))
> df <- data
Dear R-list,
I would like to use the lattice library to show several groups on
the same graph. Here's my example :
## the data
f1 <- factor(c("mod1","mod2","mod3"),levels=c("mod1","mod2","mod3"))
f1 <- rep(f1,3)
f2 <- factor(rep(c("g1","g2","g3"),each=3),levels=c("g1","g2","g3"))
df <- data
14 matches
Mail list logo