You can use main = unique(d$Subject) to solve this problem.
HTH,
b.
On 27 June 2012 08:49, Marcel Curlin wrote:
> Well at this point I have what I need (rough plot for data exploration) but
> the simplicity of the first approach is quite elegant and it has become a
> learning project. I have su
Well at this point I have what I need (rough plot for data exploration) but
the simplicity of the first approach is quite elegant and it has become a
learning project. I have succeeded in formatting the overall plot OK but
have not been able to solve the problem of titles or any kind of
label/legen
Try this alternative solution using only base functions:
# split the data into 4 data.frames
l <- split(data, data$Subject)
names(l)
# set up the graph parameters
par(mfrow=n2mfrow(length(l)), mar=c(4,4,1,1), mgp = c(2, 1, 0))
# good old for loop over the subject names
for( n in names(l)){
d <-
This solution works really nicely & I learned much by working through it.
However but I am having trouble with subplot formatting; setting
main=d$Subject results in the correct title over each plot but repeated
multiple times. Also I can't seem to format the axis labels and numbers to
reduce the sp
Hi,
Here's one approach:
plot_one <- function(d){
with(d, plot(Xvar, Yvar, t="n")) # set limits
with(d[d$param1 == 0,], lines(Xvar, Yvar, lty=1)) # first line
with(d[d$param1 == 1,], lines(Xvar, Yvar, lty=2)) # second line
}
par(mfrow=c(2,2))
plyr::d_ply(data, "Subject", plot_one)
HTH,
Hello, I have longitudinal data of the form below from N subjects; I am
trying to create figure with N small subplots on a single page, in which
each plot is from only one subject, and in each plot there is a separate
curve for each value of param1.
So in this case, there would be four plots on t
6 matches
Mail list logo