Assignment6

Assignment 6:

options(repos = c(CRAN = "https://cloud.r-project.org"))
install.packages("readxl")
Installing package into 'C:/Users/24680/AppData/Local/R/win-library/4.6'
(as 'lib' is unspecified)
package 'readxl' successfully unpacked and MD5 sums checked
Warning: cannot remove prior installation of package 'readxl'
Warning in file.copy(savedcopy, lib, recursive = TRUE): problem copying
C:\Users\24680\AppData\Local\R\win-library\4.6\00LOCK\readxl\libs\x64\readxl.dll
to C:\Users\24680\AppData\Local\R\win-library\4.6\readxl\libs\x64\readxl.dll:
Permission denied
Warning: restored 'readxl'

The downloaded binary packages are in
    C:\Users\24680\AppData\Local\Temp\RtmpGwsZJy\downloaded_packages
library(dplyr)

Attaching package: 'dplyr'
The following objects are masked from 'package:stats':

    filter, lag
The following objects are masked from 'package:base':

    intersect, setdiff, setequal, union
library(readxl)
library(ggplot2)
df <- read_excel("Airbnb_DC_25.csv")
df
# A tibble: 6,257 × 18
      id name       host_id host_name neighbourhood_group neighbourhood latitude
   <dbl> <chr>        <dbl> <chr>     <lgl>               <chr>            <dbl>
 1  3686 Vita's Hi…    4645 Vita      NA                  Historic Ana…     38.9
 2  3943 Historic …    5059 Vasa      NA                  Edgewood, Bl…     38.9
 3  4197 Capitol H…    5061 Sandra    NA                  Capitol Hill…     38.9
 4  4529 Bertina's…    5803 Bertina   NA                  Eastland Gar…     38.9
 5  5589 Cozy apt …    6527 Ami       NA                  Kalorama Hei…     38.9
 6  7103 Lovely gu…   17633 Charlotte NA                  Spring Valle…     38.9
 7 11785 Sanctuary…   32015 Teresa    NA                  Cathedral He…     38.9
 8 12442 Peaches &…   32015 Teresa    NA                  Cathedral He…     38.9
 9 13744 Heart of …   53927 Victoria  NA                  Columbia Hei…     38.9
10 14218 Quiet Com…   32015 Teresa    NA                  Cathedral He…     38.9
# ℹ 6,247 more rows
# ℹ 11 more variables: longitude <dbl>, room_type <chr>, price <dbl>,
#   minimum_nights <dbl>, number_of_reviews <dbl>, last_review <dttm>,
#   reviews_per_month <dbl>, calculated_host_listings_count <dbl>,
#   availability_365 <dbl>, number_of_reviews_ltm <dbl>, license <chr>
graph1<-select(df,room_type, price)
graph1%>%ggplot(aes(x=room_type,y=price, fill=room_type)) + geom_bar(stat="identity") +labs(x="Types of Airbnbs", y="Price", title="Price of Types of Airbnbs in DC", caption = "Source: Google Drive")
Warning: Removed 1488 rows containing missing values or values outside the scale range
(`geom_bar()`).

Insights:

The visualization I have is a bar graph that shows the shows the relationship between types of airbnbs and their prices. What I noticed from the graph is that hotel rooms and shared rooms are around the same price which makes sense since they typically have the same area of space. I also noticed that an entire home or apartment is significantly more expensive than the hotel room, shared and private room. This also makes sense since it has a significantly larger area of space than the other three types of airbnbs.