colorplot              package:adegenet              R Documentation

_R_e_p_r_e_s_e_n_t_s _a _c_l_o_u_d _o_f _p_o_i_n_t_s _w_i_t_h _c_o_l_o_r_s

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

     The 'colorplot' function represents a cloud of points with colors
     corresponding to a combination of 1,2 or 3 quantitative variables,
     assigned to RGB (Red, Green, Blue) channels. For instance, this
     can be useful to represent up to 3 principal components in space.
     Note that the property of such representation to convey
     multidimensional information has not been investigated.

     'colorplot' is a S3 generic function. Methods are defined for
     particular objects, like 'spca' objects.

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

     colorplot(...)

     ## Default S3 method:
     colorplot(xy, X, axes=1:ncol(X), add.plot=FALSE, defaultLevel=0, ...)

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

      xy: a numeric matrix with two columns (e.g. a matrix of spatial
          coordinates.

       X: a matrix-like containing numeric values that are translated
          into the RGB system. Variables are considered to be in
          columns.

    axes: the index of the columns of X to be represented. Up to three
          axes can be chosen.

add.plot: a logical stating whether the colorplot should be added to
          the existing plot (defaults to FALSE).

defaultLevel: a numeric value between 0 and 1, giving the default level
          in a color for which values are not specified. Used whenever
          less than three axes are specified.

     ...: further arguments to be passed to other methods. In
          'colorplot.default', these arguments are passed to
          plot/points functions. See '?plot.default' and '?points'.

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

     Invisibly returns the matched call.

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

     Thibaut Jombart t.jombart@imperial.ac.uk

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

     # a toy example
     xy <- expand.grid(1:10,1:10)
     df <- data.frame(x=1:100, y=100:1, z=runif(100,0,100))
     colorplot(xy,df,cex=10,main="colorplot: toy example")

     # a genetic example using a sPCA
     if(require(spdep) & require(ade4)){
     data(spcaIllus)
     dat3 <- spcaIllus$dat3
     spca3 <- spca(dat3,xy=dat3$other$xy,ask=FALSE,type=1,plot=FALSE,scannf=FALSE,nfposi=1,nfnega=1)
     colorplot(spca3, cex=4, main="colorplot: a sPCA example")
     text(spca3$xy[,1], spca3$xy[,2], dat3$pop)
     mtext("P1-P2 in cline\tP3 random \tP4 local repulsion")
     }

