Description Usage Arguments Format Details Warning Examples
This dataset is a list, cast in matrix format, that can be used to lump ecotypes into coarser groups for analysis and plotting. The current implementation includes vectors for: transformation, naming/labelling, and suggested plotting colours
1 |
which.grouping |
one of |
type.of.data |
one of |
A list cast into matrix format with four rows (grouping scenarios) and three columns (possible data types for that scenario). The four different grouping scenarios are:
Identity (‘identity
’) maps the class onto itself, that is, there is no lumping, but
labels and colours are provided.
Dominant Species (‘domSpecies
’) groups classes by the dominant (tree) species.
Dominant Group (‘domGroup
’) groups classes by the dominant growth-form.
Maximum Granularity (‘maxGranularity
’) groups the classes in what is deemed reasonable
for our data, that is, we attempt to maximize the number of groupings while maintaining a reasonable number of
samples in each group for statistical significance and reliability.
The different types of data that can be extracted are:
Transformation Vector (‘transform
’) a transformation vector converting input factors
(ecoSites) to output factors (groupings). Functionally it is a lookup table that maps input classes to output
classes. See ‘examples’ for how to use it.
Labels (‘labels
’) meaningful names for the output groups.
Plotting Colours (‘colours
’) suggested plotting colours for the output groups. These
are easy to pass to, for example, plotting functions.
This built-in transformation 'function' encodes several different grouping scenarios. Each is provided with labels for the groups as well as suggested colours. Following is a description of the four build-in encoding for the FEC classification system McLaughlan, M. S., Robert A. Wright, and R. D. Jiricka. Field Guide to the Ecosites of Saskatchewan's Provincial Forests. Prince Albert, Sask: Ministry of Environment, 2010.
Ecotype | Dominant Species Class | Dominant Group Class | Maximum Granularity Class |
BS 01 -- Sand heather | 1 (barren) | 1 (barren) | 1 (sparse vegetation) |
BS 02 -- Lichen felsenmeer | 1 | 1 | 1 |
BS 03 -- Jack pine, blueberry, lichen | 2 (pine) | 2 (conifer) | 2 |
BS 04 -- Jack pine, black spruce, feathermoss | 2 | 2 | 3 |
BS 05 -- Jack pine, birch, feathermoss | 2 | 2 | 4 |
BS 06 -- Jack pine, aspen, alder | 2 | 2 | 5 |
BS 07 -- Black spruce, blueberry, lichen | 3 (bs) | 2 | 6 |
BS 08 -- Black spruce, birch, lichen | 3 | 2 | 7 |
BS 09 -- Black spruce, pine, feathermoss | 3 | 2 | 8 |
BS 10 -- Black spruce, birch, feathermoss | 3 | 2 | 9 |
BS 11 -- White spruce, fir, feathermoss | 4 (ws) | 2 | 10 |
BS 12 -- White spruce, crowberry, feathermoss | 4 | 2 | 11 |
BS 13 -- Birch, black spruce, aspen | 5 (birch) | 3 (decid) | 12 |
BS 14 -- Birch, lingonberry, lab tea | 5 | 3 | 13 |
BS 15 -- Aspen, birch, alder | 6 (aspen) | 3 | 14 |
BS 16 -- Black spruce, poplar, alder swamp | 7 (swamp) | 4 (wetland) | 15 (group swamp in with treed bog) |
BS 17 -- Black spruce bog | 8 (bog) | 4 | 15 |
BS 18 -- Lab tea shrubby bog | 8 | 4 | 16 |
BS 19 -- Graminoid bog | 8 | 4 | 17 (sparse bog) |
BS 20 -- Open bog | 8 | 4 | 17 |
BS 21 -- Tamarack fen | 9 (fen) | 4 | 18 (upright fen) |
BS 22 -- Leatherleaf fen | 9 | 4 | 18 |
BS 23 -- Willow shrubby fen | 9 | 4 | 19 |
BS 24 -- Graminoid fen | 9 | 4 | 20 (sparse fen) |
BS 25 -- Open fen | 9 | 4 | 20 |
BS 26 -- Rush sandy shore | 10 (shore) | 4 | 21 (shoreline) |
BS 27 -- Sedge rocky shore | 10 | 4 | 21 |
The following expressions will not work as transformation functions. See factor
, especially the Warning
section for more information on this gotcha.
siteData$Ecotype
returns a factor list, not a numeric list representing the factors.
ecoGroup[['identity','transform']][siteData$Ecotype]
will regroup based on the factor level indices, NOT the factors.
as.numeric(siteData$Ecotype]
returns the factor indices, not a numeric representation of the factors.
(1:27)[siteData$Ecotype]
returns the factor index rather than the ecoGroup.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | data (siteData)
ecoGroup[['domSpecies','transform']][ factorValues(siteData$ecoType) ]
## Code for generating this object--so you can make your own!
# Create a shell to fill with data
ecoGroup <- list(); length(ecoGroup) <- 12;
dim(ecoGroup) <- c(4,3) # Three rows (classifiers), three columns (type of data)
rownames(ecoGroup)=c('identity','domSpecies','maxGranularity','domGroup')
colnames(ecoGroup)=c('transform','labels','colours')
# Fill with data in increasing order of lumping
ecoGroup['identity',] <- list(
c(1:27),
paste0('BS',1:27),
c('#FFFF00','#E6E600','#FF9900','#E47A07','#BD6A06','#965B05','#4C7300','#5E8D00','#70A800',
'#82C300','#008C4B','#00A04B','#ABFF8F','#42FF07','#7EFF54','#41DBCF','#00A884','#3FC5A5',
'#7EE2C6','#BEFFE8','#97E2FF','#8DD4F0','#83C6E1','#79B8D2', '#6FABC3','#AC44E7','#C077E3')
)
ecoGroup['maxGranularity',] <- list(
c(1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,15,16,17,17,18,18,19,20,20,21,21),
c('Sparse',paste0('BS',3:15),'Treed bog/swamp','BS18','Sparse bog','Upright fen','BS23','Sparse fen','Shoreline'),
c('#E6E600','#FF9900','#E47A07','#BD6A06','#965B05','#4C7300','#5E8D00','#70A800','#82C300',
'#008C4B','#00A04B','#ABFF8F','#42FF07','#7EFF54','#00A884','#3FC5A5','#BEFFE8','#97E2FF',
'#83C6E1','#6FABC3','#C077E3')
)
ecoGroup['domSpecies',] <- list(
c(1,1,2,2,2,2,3,3,3,3,4,4,5,5,6,7,8,8,8,8,9,9,9,9,9,10,10),
c('1'="Barren",'2'="Pine",'3'="Black Sp",'4'="White Sp",'5'="Birch",'6'="Aspen",'7'="Swamp",
'8'="Bog",'9'="Fen",'10'="Shore"),
c('E6E600','E47A07','70A800','00A04B','42FF07','41DBCF','3FC5A5','83C6E1','C077E3','004DA8','000000')
)
ecoGroup['domGroup',] <- list(
c(1,1,2,2,2,2,2,2,2,2,2,2,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4),
c("Barren","Conifer","Decid","Wetland"),
c('E6E600','00A04B','42FF07','83C6E1')
)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.