Skip to content

Latest commit

 

History

History
50 lines (37 loc) · 1.29 KB

README.md

File metadata and controls

50 lines (37 loc) · 1.29 KB

agrodata

Lifecycle: experimental

The goal of agrodata is to provide dataset examples for statistical analysis.

Installation

You can install the development version of agrodata from GitHub with:

# install.packages("pak")
pak::pak("NEPEM-UFSC/agrodata")

Example

library(agrodata)
library(ggplot2)
df <- ad_normal()


ggplot(df, aes(length)) +
  geom_histogram(aes(y = after_stat(..density..)),
                 bins = 60) +
  labs(x = "Length of the grain (mm)",
       y = "Density",
       title = "Distribution of the length of 86,436 flax grains",
       subtitle = "The red line represents the theoretical normal distribution") +
  stat_function(fun = dnorm,
                geom = "line",
                col = "red",
                linewidth = 1,
                args = list(
                  mean = mean(df$length),
                  sd = sd(df$length)
                ))