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 DataCamp Workspace