Hanae- Homework 3

This is my submission of Homework 3.

Hanae Bouazza true
08-16-2021

##Loading Library

##Data

bookings<-read_csv(file="../../_data/hotel_bookings.csv")

##Using summarise() and group_by()

group_by(bookings, hotel)%>%
summarise(meanAdr=mean(adr), n=n())
# A tibble: 2 × 3
  hotel        meanAdr     n
  <chr>          <dbl> <int>
1 City Hotel     105.  79330
2 Resort Hotel    95.0 40060

##Using arrange(), select(), and filter()

statusByCountry<-arrange(bookings, reservation_status)%>%
select("hotel", "country", "reservation_status")
filter(statusByCountry, country=="USA")
# A tibble: 2,097 × 3
   hotel        country reservation_status
   <chr>        <chr>   <chr>             
 1 Resort Hotel USA     Canceled          
 2 Resort Hotel USA     Canceled          
 3 Resort Hotel USA     Canceled          
 4 Resort Hotel USA     Canceled          
 5 Resort Hotel USA     Canceled          
 6 Resort Hotel USA     Canceled          
 7 Resort Hotel USA     Canceled          
 8 Resort Hotel USA     Canceled          
 9 Resort Hotel USA     Canceled          
10 Resort Hotel USA     Canceled          
# … with 2,087 more rows

Reuse

Text and figures are licensed under Creative Commons Attribution CC BY-NC 4.0. The figures that have been reused from other sources don't fall under this license and can be recognized by a note in their caption: "Figure from ...".

Citation

For attribution, please cite this work as

Bouazza (2021, Aug. 16). DACSS 601 August 2021: Hanae- Homework 3. Retrieved from https://mrolfe.github.io/DACSS601August2021/posts/2021-08-16-hanae-homework-3/

BibTeX citation

@misc{bouazza2021hanae-,
  author = {Bouazza, Hanae},
  title = {DACSS 601 August 2021: Hanae- Homework 3},
  url = {https://mrolfe.github.io/DACSS601August2021/posts/2021-08-16-hanae-homework-3/},
  year = {2021}
}