kselect              package:adehabitat              R Documentation

_K-_S_e_l_e_c_t _A_n_a_l_y_s_i_s: _a _M_e_t_h_o_d _t_o _A_n_a_l_y_s_e _t_h_e _H_a_b_i_t_a_t _S_e_l_e_c_t_i_o_n _b_y
_A_n_i_m_a_l_s

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

     Performs a multivariate analysis of ecological data (K-select
     analysis).

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

     kselect(dudi, factor, weight, scannf = TRUE, nf = 2, ewa = FALSE)
     print.kselect(x, ...)
     kplot.kselect(object, xax = 1, yax = 2, csub = 2, possub = c("topleft",
                   "bottomleft", "bottomright", "topright"),
                   addval = TRUE, cpoint = 1, csize = 1, clegend = 2, ...)
     hist.kselect(x, xax = 1, mar = c(0, 0, 0, 0), ampl = 1, 
                  col.out = gray(0.75), col.in = gray(0.75), ncell = TRUE,
                  denout = NULL, denin = NULL, lwdout = 1, lwdin = 1,
                  maxy = 1, csub = 2, possub =
                  c("bottomleft", "topleft", "bottomright", "topright"),
                  ncla = 15, ...) 
     plot.kselect(x, xax = 1, yax = 2, ...)

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

    dudi: an object of class 'dudi'

  factor: a factor with the same length as 'nrow(dudi$tab)'

  weight: a numeric vector of integer values giving the weight
          associated to the rows of 'dudi$tab'.

  scannf: logical. Whether the eigenvalues bar plot should be displayed

      nf: if 'scannf = FALSE', an integer indicating the number of kept
          axes

     ewa: logical. If 'TRUE', uniform weights are given to all animals
          in the analysis. If 'FALSE', animal weights are given by the
          proportion of relocations of each animal (i.e. an animal with
          10 relocations has a weight 10 times lower than an animal
          with 100 relocations)

       x: an object of class 'kselect'

  object: an object of class 'kselect'

     xax: the column number for the x-axis

     yax: the column number for the y-axis

  addval: logical.  If 'TRUE', the frequency of the relocations per
          animal is displayed (see examples)

  cpoint: the size of the points (if 0, the points where no relocations
          are found are not displayed)

     mar: the margin parameter (see 'help(par)').

    ampl: the amplification factor (i.e. 'ylim = c(-1 , 1) / ampl')

 col.out: character string.  The color of the upper histogram

  col.in: character string.  The color of the lower histogram

   ncell: logical. If 'TRUE', the histogram shows the distribution of
          the cells of  the raster map where at least one relocation is
          found. If 'FALSE', the histogram shows the distribution of
          the relocations

  denout: the density of shading lines for the upper histogram, in
          lines per inch (see 'help(hist)' for further informations)

   denin: the density of shading lines for the lower histogram, in
          lines per inch

  lwdout: the line width for the upper histogram

   lwdin: the line width for the lower histogram

    maxy: the maximum Y coordinate (since the histogram draws
          frequencies, default value of 'maxy' is 1)

    csub: the character size for the legend, used with
          'par("cex")*csub'

   csize: the size coefficient for the points

 clegend: the character size for the legend used by
          'par("cex")*clegend'

  possub: a character string indicating the sub-title position
          '("topleft", "topright", "bottomleft", "bottomright")'

    ncla: the number of classes of the histograms

     ...: additional arguments to be passed to the generic function
          'hist', 'print' or, in the case of 'plot.kselect', 's.distri'

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

     'kselect' returns a list of the class 'kselect' and 'dudi' (see
     'dudi').

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

     Clment Calenge calenge@biomserv.univ-lyon1.fr

_R_e_f_e_r_e_n_c_e_s:

     Calenge, C., Dufour, A.B. and Maillard, D. (_submitted_). K-select
     analysis, a new method to analyse habitat selection in
     radio-tracking studies.

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

     'sahrlocs2kselect' for conversion of objects class 'sahrlocs' to
     objects suitable for a K-select analysis, 's.distri', and 'dudi'
     for class 'dudi'.

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

     ## Not run: 
     ## Loads the data
     data(puechabon)
     sahr <- puechabon$sahr

     ## prepares the data for the kselect analysis
     x <- sahrlocs2kselect(sahr)
     tab <- x$tab

     ## Example of analysis with two variables: the slope and the elevation.
     ## Have a look at the use and availability of the two variables
     ## for the 4 animals
     tab <- tab[,((names(tab) == "Slope")|(names(tab) == "Elevation"))]
     tab <- scale(tab)
     tmp <- split.data.frame(tab, x$factor)
     wg <- split(x$weight, x$factor)
     opar <- par(mfrow = n2mfrow(nlevels(x$factor)))
     for (i in names(tmp))
       s.distri(scale(tmp[[i]]), wg[[i]])
     par(opar)

     ## We call a new graphic window
     x11()
     ## A K-select analysis
     acp <- dudi.pca(tab, scannf = FALSE, nf = 2)
     kn <- kselect(acp, x$factor, x$weight,
      scannf = FALSE, nf = 2)

     # use of the generic function scatter
     scatter(kn)

     # Displays the first factorial plane
     kplot(kn)
     kplot(kn, cellipse = 0, cpoint = 0)
     kplot(kn, addval = FALSE, cstar = 0)

     # this factorial plane can be compared with
     # the other graph to see the rotation proposed by
     # the analysis
     graphics.off()

     # Displays the first factorial axis
     hist(kn)

     # Displays the second factorial axis
     hist(kn, xax = 2)

     # Summary of the analysis
     plot(kn)
     ## End(Not run)

