class_center | R Documentation |
This function can be used to divide the data into classes, based on minimum value and class interval of a given variable, and create a column with the center of each class.
class_center(df, y, ci = 3, ymin = 5)
df |
A data frame. |
y |
Quoted name of a variable, or a vector to be classified. |
ci |
Numeric value for the class interval used to classify the data. Default: |
ymin |
Numeric value for minimum value value to be considered in the classifications. dbh values smaller than this will be dismissed from the classification. Default: |
if df
is supplied, a data frame containing the supplied data with a new column for the center of classes; if df
is missing, a vetor with the center of class.
Sollano Rabelo Braga sollanorb@gmail.com
library(forestmangr)
library(dplyr)
data("exfm20")
head(exfm20)
# n
# Number of individuals per ha per diameter class
class_center(df = exfm20, y = "dbh", ci = 10, ymin = 10)
exfm20 %>%
mutate(CC = class_center(y = dbh, ci = 10, ymin = 10))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.