# NOT RUN {
data(eco.test)
# method sturges-smax: in this case, the program generates
# classes using the Sturge's rule.
# As smax and smin are undefined, the program uses the default
# options (smin = 0, and smax = maximum inter-individual distance)
classlist <- eco.lagweight(eco[["XY"]])
classlist
# method sturges-smax: idem, but smax = 16
classlist <- eco.lagweight(eco[["XY"]], smax=16)
## using smax <16 in this case generates empty classes,
## which is not allowed
# method sturges-smax: idem, but smin = 3
classlist <- eco.lagweight(eco[["XY"]], smin = 3, smax = 15)
# method sturges-smax: complete range,
# and cummulative = TRUE (instead of using
# lower and upper limits for each class, only the upper is used in turn)
classlist <- eco.lagweight(eco[["XY"]], cummulative = TRUE)
# method n.classes-smax: complete range partitioned in 4 classes
classlist <- eco.lagweight(eco[["XY"]], nclass = 4)
# method n.classes-smax: idem, but smax = 15
classlist <- eco.lagweight(eco[["XY"]], nclass = 4, smax = 15)
# method int-smax: the complete range partitioned each <int> units
# of inter-individual distance
classlist <- eco.lagweight(eco[["XY"]], int = 2)
# method int-smax: idem, but smax = 15 and smin = 3
classlist <- eco.lagweight(eco[["XY"]], int = 2, smin = 3, smax = 15)
# method equal.size: n individuals in each class,
# partitioning the complete range.
classlist <- eco.lagweight(eco[["XY"]], size = 1000)
## In the latter example, as an inter-individual distance
## appear more than one time (different individuals pairs,
## identical distances), with a size <700 the limits
## of some classes cannot be defined, and this is not allowed
# method equal.size: n individuals in each class,
# but smax = 15
classlist <- eco.lagweight(eco[["XY"]], size = 1000, smax = 15)
# method kmax: sequence from k = 1 to k = n, in this case, n = 3
classlist <- eco.lagweight(eco[["XY"]], kmax = 3)
# method kmax: idem, but elements self-included
# (i.e., the pairs i-i, for all individuals i, are included)
classlist <- eco.lagweight(eco[["XY"]], kmax = 3, self = TRUE)
# method seqvec: a vector with the breaks is used
vec <- seq(0, 10, 2)
classlist <- eco.lagweight(eco[["XY"]], seqvec = vec)
#-----------------------
# ACCESSORS USE EXAMPLE
#-----------------------
# the slots are accessed with the generic format
# (ecoslot. + name of the slot + name of the object).
# See help("EcoGenetics accessors")
ecoslot.BREAKS(classlist) # information about breaks. It includes the upper and lower limits
# }
# NOT RUN {
# }
Run the code above in your browser using DataCamp Workspace