Plot Method for observed data
Plot all observed variables in matrix formalt
obsplot(x, ..., which = NULL, xyswap = FALSE, ask = NULL)
x |
a Several other matrices or data.frames can be passed in the If the first column of |
which |
the name(s) or the index to the variables that should be plotted. Default = all variables, except the first column. |
ask |
logical; if |
xyswap |
if |
... |
additional arguments. The graphical arguments are passed to The dots may contain other matrices and data.frames with observed data
to be plotted on the same graphs as The arguments after ... must be matched exactly. |
The number of panels per page is automatically determined up to 3 x 3
(par(mfrow = c(3, 3))
). This default can be overwritten by
specifying user-defined settings for mfrow
or mfcol
.
Set mfrow
equal to NULL
to avoid the plotting function to
change user-defined mfrow
or mfcol
settings.
Other graphical parameters can be passed as well. Parameters
are vectorized, either according to the number of plots
(xlab, ylab
, main, sub
, xlim, ylim
, log
,
asp, ann, axes, frame.plot
,panel.first,panel.last
,
cex.lab,cex.axis,cex.main
) or
according to the number of lines within one plot (other parameters
e.g. col
, lty
, lwd
etc.) so it is possible to
assign specific axis labels to individual plots, resp. different plotting
style. Plotting parameter ylim
, or xlim
can also be a list
to assign different axis limits to individual plots.
## 'observed' data AIRquality <- cbind(DAY = 1:153, airquality[, 1:4]) head(AIRquality) obsplot(AIRquality, type="l", xlab="Day since May") ## second set of observed data AIR2 <- cbind( 1:100, Solar.R = 250 * runif(100), Temp = 90-30*cos(2*pi*1:100/365) ) obsplot(AIRquality, AIR2, type = "l", xlab = "Day since May" , lwd = 1:2) obsplot(AIRquality, AIR2, type = "l", xlab = "Day since May" , lwd = 1 : 2, which =c("Solar.R", "Temp"), xlim = list(c(0, 150), c(0, 100))) obsplot(AIRquality, AIR2, type = "l", xlab = "Day since May" , lwd = 1 : 2, which =c("Solar.R", "Temp"), log = c("y", "")) obsplot(AIRquality, AIR2, which = 1:3, xyswap = c(TRUE,FALSE,TRUE)) ## ' a data.frame, with 'treatments', presented in long database format Data <- ToothGrowth[,c(2,3,1)] head (Data) obsplot(Data, ylab = "len", xlab = "dose") # same, plotted as two observed data sets obsplot(subset(ToothGrowth, supp == "VC", select = c(dose, len)), subset(ToothGrowth, supp == "OJ", select = c(dose, len)))
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.