conspire(indata, formula, subset=NULL, lty=NULL, col=NULL, xlim, ylim,
xlab, ylab)
lty
controlling the line style of each plot.col
controlling the colour of each plot.plot.formula
but offers
some extra functionality.
The left and right hand sides of the formula argument
are evaluated in the data frame indata
,
and the results are plotted against each other
(the left side on the $y$ axis
against the right side on the $x$ axis).
Both left and right sides may be variables in the data frame
or expressions in these variables. Multiple curves may be specified by a single formula
of the form
cbind(y1,y2,...,yn) ~ x
, where x,y1,y2,...,yn
are
expressions involving the variables in the data frame.
Each of the variables y1,y2,...,yn
in turn will be plotted
against x
.
See the examples.
library(spatstat)
df <- data.frame(x=1:20, y=sqrt(1:20), z = sqrt(1:20) + runif(20))
conspire(df, y ~ x) # plots y against x
conspire(df, log(y) ~ log(x)) # plots log(y) against log(x)
conspire(df, z - sqrt(x) ~ x) # plots z - sqrt(x) against x
conspire(df, cbind(y,z) ~ x) # plots y against x AND z against x
conspire(df, cbind(z,sqrt(x)) ~ x)
# plots z against x AND sqrt(x) against x
conspire(df, cbind(z - sqrt(x),0) ~ x)
# plots z - sqrt(x) against x
# with dashed horizontal line at height 0
conspire(df, cbind(y,z) ~ x, col=c(2,3))
# plots y against x in colour 2
# and z against x in colour 3
conspire(df, y ~ x, subset=quote(x < 10))
# plots y against x for x < 10
Run the code above in your browser using DataLab