## plotting the taper curve of a tree
oldpar <- par(no.readonly = TRUE)
par(mfrow = c(1, 1))
t <- data.frame(spp = 1, D1 = 40, H = 35)
tree <- buildTree(tree = t)
plot(tree, type = "l", las = 1, legend = TRUE)
plot(tree, bark = TRUE, las = 1)
plot(tree, bark = FALSE, las = 1)
t <- data.frame(spp = c(1, 1), D1 = c(40, 35), H = c(35, 30))
tree <- buildTree(tree = t)
plot(tree, bark = FALSE, las = 1, legend = TRUE)
plot(tree, bark = TRUE, las = 1, legend = TRUE)
t <- data.frame(spp = c(1, 8), D1 = 40, H = 35)
tree <- buildTree(tree = t)
plot(tree, bark = NULL, las = 1, col.bark = "blue", legend = TRUE)
plot(tree[1, ], main = getSpeciesCode(tree[1, ]$spp, out = "long"))
plot(tree[2, ], main = getSpeciesCode(tree[2, ]$spp, out = "scientific"))
par(mfrow = c(2, 1))
plot(tree, bark = TRUE, las = 1)
## now add assortments into taper curve
par(mfrow = c(1, 1))
ass <- getAssortment(tree, sort = list(lX = 1, fixN = 2, fixL = 4, fixA = 10))
plot(tree, assort = ass)
plot(tree, bark = FALSE, assort = ass)
plot(tree, bark = FALSE, assort = ass, legend = TRUE)
plot(tree[1, ], assort = ass[ass$tree == 1, ], main = "first tree in subset")
plot(tree[2, ], assort = ass[ass$tree == 2, ], main = "second tree in subset")
## adding own assortment labels using column 'assortname'
ass$assortname <- ifelse(grepl("Fix", ass$Sort), paste0("Fix:", ass$length), ass$Sort)
plot(tree, assort = ass)
par(oldpar)
Run the code above in your browser using DataLab