# NOT RUN {
x <- rnorm(1000)
gf_histogram(~x, bins = 30)
gf_dhistogram(~x, bins = 30)
gf_dhistogram(~x, binwidth = 0.5, center = 0, color = "black")
gf_dhistogram(~x, binwidth = 0.5, boundary = 0, color = "black")
gf_dhistogram(~x, bins = 30) %>%
gf_fitdistr(dist = "dnorm") # see help for gf_fitdistr() for more info.
gf_histogram(~x, fill = ~ (abs(x) <= 2), boundary = 2, binwidth = 0.25)
data(penguins, package = "palmerpenguins")
gf_histogram(~ bill_length_mm | species, data = penguins, binwidth = 0.25)
gf_histogram(~age,
data = mosaicData::HELPrct, binwidth = 5,
fill = "skyblue", color = "black"
)
# bins can be adjusted left/right using center or boundary
gf_histogram(~age,
data = mosaicData::HELPrct,
binwidth = 5, fill = "skyblue", color = "black", center = 42.5
)
gf_histogram(~age,
data = mosaicData::HELPrct,
binwidth = 5, fill = "skyblue", color = "black", boundary = 40
)
gf_histogram(age ~ .,
data = mosaicData::HELPrct,
binwidth = 5, fill = "skyblue", color = "black", boundary = 40
)
gf_histogramh(~x, bins = 30)
gf_histogram(x ~., bins = 30)
gf_histogramh(x ~ ., bins = 30)
gf_histogramh(x ~ stat(density), bins = 30)
gf_dhistogramh(~x, bins = 30)
gf_dhistogram(x ~ ., bins = 30)
gf_dhistogramh(x ~ ., bins = 30)
# }
Run the code above in your browser using DataLab