yields.unstacked | R Documentation |
This data is from a crop experiment where the crops were grown in three different soil types, and the yield was taken from 10 randomly chosen fields per soil type. This is the unstacked version of the data, with one column for each soil type.
yields.unstacked
A data frame with 10 observations (rows) and 3 variables (columns).
Column name | Data type | Description | Values | |
[,1] | sand | integer | Yield from fields with sand | (6 -17) |
[,2] | clay | integer | Yield from fields with clay | (3 - 17) |
[,3] | loam | integer | Yield from fields with loam | (9 - 18) |
yields
# Summary of the variables
summary(yields.unstacked)
# Combining the columns into one single column
# with factor as data type
stacked_yields <- stack(yields.unstacked)
# Renaming the columns of the transformed data frame
colnames(stacked_yields) <- c("yields", "soil")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.