picketplot             package:Heatplus             R Documentation

_B_a_r_p_l_o_t_s _f_o_r _S_e_v_e_r_a_l _B_i_n_a_r_y _V_a_r_i_a_b_l_e_s

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

     Display one or more binary variables by using black bars for
     presence/validity of a condition, empty space for
     absence/invalidity, and an extra color for missing values.
     Additionally, an index plot for one interval scaled variable can
     be added, possibly with a smoothing function.

     This routine is primarily intended for augmenting heatmaps. It
     might be useful in other contexts, but misses most frills for
     using it comfortably.

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

     picketplot(x, covariate = NULL, grp = NULL, grpcol, grplabel = NULL, 
                add = FALSE, control = list())

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

       x: a matrix or data frame containing the data.

covariate: the index of the column in 'x' that contains the interval
          scaled variable, if any.

     grp: cluster indices for the rows of 'x', used for assigning
          background color.

  grpcol: colors corresponding to the clusters.

grplabel: cluster names.

     add: logical indicating whether to start a new plot, or whether to
          add the plot to the existing one.

 control: a list of parameters controlling the appearance of the plot,
          see Details.

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

     The following named list elements can be set to change the
     appearance of the plot:

_b_o_x_w the relative width of a marking box.

_b_o_x_h the relative height of a marking box.

_h_b_u_f_f the horizontal separation around marking boxes; equals half the 
     horizontal distance between two marking boxes.

_v_b_u_f_f ditto for vertical separation.

_s_p_a_n passed on to 'loess' used for the smoothing curve.

_n_a_c_o_l color for missing values of binary variables.

_d_e_g_r_e_e if 0, no smoothing line is drawn; otherwise passed on to 'loess'
     used for  the smoothing curve.

_c_e_x._l_a_b_e_l the character size for 'grplabel'.

_N_o_t_e:

     The plot looks like a more or less derelict picket fence, and
     'picketplot' sounds somewhat like the 'pocketplot' used in
     geostatistics.

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

     Alexander Ploner <Alexander.Ploner@ki.se>

_S_e_e _A_l_s_o:

     'heatmap_plus'

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

     # without covariate
     mm = cbind(sample(0:1, 42, rep=TRUE), sample(0:1, 42, rep=TRUE))
     mm[sample(42, 5), 1] = NA
     picketplot(mm)

     # with clustering
     cl = rep(1:3, c(10,22,10))
     cn = c("Cluster I","Cluster II","Cluster III")
     cc = c("lightblue","lightgreen","lightpink") # windows palette
     picketplot(mm, grp=cl, grplabel=cn, grpcol=cc)

     # add a covariate; setting the colnames makes the variable labels
     mm = cbind(mm, rnorm(42) + cl/2)
     colnames(mm) = c("State A","State B", "X")
     picketplot(mm, covariate=3,grp=cl, grplabel=cn, grpcol=cc)

     # using extra controls
     picketplot(mm, covariate=3,grp=cl, grplabel=cn, grpcol=cc, control=list(nacol="white", degree=0))

