conspire              package:spatstat              R Documentation

_P_l_o_t _T_o_g_e_t_h_e_r _A_c_c_o_r_d_i_n_g _t_o _a _F_o_r_m_u_l_a

_D_e_s_c_r_i_p_t_i_o_n:

     Given a data frame and a formula involving variables in the data
     frame, plot the left hand side of the formula versus the right
     hand side.

_U_s_a_g_e:

      conspire(indata, formula, subset=NULL, lty=NULL, col=NULL)

_A_r_g_u_m_e_n_t_s:

  indata: A data frame, containing the variables to be plotted or
          variables from which the plotting coordinates can be
          computed. 

 formula: an S language formula determining which variables or
          expressions are plotted.  

  subset: (optional) subset of rows of the data frame that will be
          plotted. 

     lty: (optional) numeric vector of values of the graphical
          parameter `lty' controlling the line style of each plot. 

     col: (optional) numeric vector of values of the graphical
          parameter `col' controlling the colour of each plot. 

_D_e_t_a_i_l_s:

     This function is like `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.

_V_a_l_u_e:

     none. Side effect is a plot.

_A_u_t_h_o_r(_s):

     Adrian Baddeley adrian@maths.uwa.edu.au <URL:
     http://www.maths.uwa.edu.au/~adrian/> and Rolf Turner
     rolf@math.unb.ca <URL: http://www.math.unb.ca/~rolf>

_E_x_a_m_p_l_e_s:


        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



