Import data

dog <- read_excel("../01_module4/data/myData.xlsx") %>%
    janitor::clean_names() %>%
    filter(!type %>% str_detect("Plott"))

Introduction

Questions

Variation

ggplot(data = dog) +
  geom_bar(mapping = aes(x = type))

Visualizing distributions

ggplot(data = dog) +
  geom_histogram(mapping = aes(x = coat_grooming_frequency))
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

ggplot(data = dog, mapping = aes(x = barking_level, color = length)) +
  geom_freqpoly()
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

Typical values

ggplot(data = dog, mapping = aes(x = adaptability_level)) +
  geom_histogram()
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

Unusual values

Missing Values

Covariation

A categorical and continuous variable

ggplot(data = dog, mapping = aes(x = watchdog_protective_nature)) + 
  geom_freqpoly(mapping = aes(colour = type), binwidth = 0.5)

ggplot(data = dog, mapping = aes(x = length, y = shedding_level)) +
  geom_boxplot()

Two categorical variables

ggplot(data = dog) +
  geom_count(mapping = aes(x = length, y = type))

Two continous variables

ggplot(data = dog) +
  geom_point(mapping = aes(x = energy_level, y = barking_level), alpha = 0.3)

Patterns and models

ggplot(data = dog) + 
  geom_jitter(mapping = aes(x = breed, y = drooling_level))