-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathweek-4-hands-on-filters-plots.r
More file actions
34 lines (25 loc) · 1.01 KB
/
Copy pathweek-4-hands-on-filters-plots.r
File metadata and controls
34 lines (25 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# title: 'Lesson 3: Filters and Plots'
# file: Course 7 > Week 4 > Lesson 3_Filters.Rmd
# install.packages('ggplot2')
# library(ggplot2)
# install.packages('tidyverse')
# library(tidyverse)
# hotel_bookings <- read.csv("hotel_bookings.csv")
# head(hotel_bookings)
# colnames(hotel_bookings)
# ggplot(data = hotel_bookings) +
# geom_point(mapping = aes(x = lead_time, y = children))
# ggplot(data = hotel_bookings) +
# geom_bar(mapping = aes(x = hotel, fill = market_segment))
# ggplot(data = hotel_bookings) + geom_bar(mapping = aes(x = hotel)) + facet_wrap(~market_segment)
# onlineta_city_hotels <- filter(hotel_bookings,
# (hotel=="" &
# hotel_bookings$market_segment==""))
# View(onlineta_city_hotels)
# ANOTHER WAY
# onlineta_city_hotels_v2 <- hotel_bookings %>%
# filter(hotel=="City Hotel") %>%
# filter(market_segment=="Online TA")
# View(onlineta_city_hotels_v2)
# ggplot(data = variable_name) +
# geom_point(mapping = aes(x = lead_time, y = children))