In this first two parts of the exercise, I want you to explore the key variables of AirBnB use, the locations of AirBnB places, and some (potential) indications on how it impacts the rental market. In the third part, I want you to explore whether or not we can find a relationship between the location of subway stations and location, type, and features of AirBnB places. In each task description, I ask you to provide specific visualizations or data analyses, but please include some written explanations as well to situate the visualizations you provide. Do not directly include any code in the rendered output when presenting your results.
Question: Provide a map to show where in New York City AirBnB listings are located. Provide a second map in which you summarize the density of these listings and highlight the hotspots for AirBnB locations. Make sure to annotate a few hotspots on the map.
Map of AirBnB locations:
Heatmap of AirBnB locations:
Discussion: I used tmap package for one plot, and ggplot2 and ggmap for another to practice using both. These are simple plots, so I did not overcomplicate things with too many annotations and unnecessary additions. Although on the first map, we have trouble telling how many AirBnB listings there are at each neighborhood due to the 40,000+ listings covering most of Manhattan and Brooklyn, we can tell distinct hotspots of AirBnB activity on the second map. I chose to highlight the two biggest hotspots in East Village and Williamsburg.
Question: An Airbnb host can set up a calendar for their listing so that it is only available for a few days or weeks a year. Other listings are available all year round (except for when it is already booked). Entire homes or apartments highly available and rented frequently year-round to tourists probably don’t have the owner present, are illegal, and more importantly, are displacing New Yorkers.
Choose a combination of both non-map and map graphs to explore where in NYC listings are available sporadically vs. year-round. Make sure to highlight the neighborhoods where most listings appear to be permanent or semi-permanent rentals. Try to estimate the average monthly income from such rentals.
Use these and other variables to provide some information about how such permanent rentals differ from sporadic rentals in a concise format (i.e. try to combine summary information and plots in a smart way). Feel free to use summary statistics, map, and/or non-map graphical displays.
Discussion: There doesn’t seem to be much difference in nightly price for an AirBnB listing that is rented out year-round versus one that is rented out only sporadically. Similarly, there is no difference in ratings (plot not shown due to repetitive nature of information) and the heatmap of locations below shows that the concentrations of both types of listings are in the same regions, although there are far fewer year-round listings. However, hosts that rent at least one property year-round, tend to rent more properties on average. Although the larger share of total income from AirBnB listings is coming from sporadic rentals, due to the higher number of them, the year-long rental income is not small (above 5 million). Moreover, the potential mean monthly income from year-long rentals is twice higher than that for sporadic rentals, at around four thousand dollars, making it a lucrative business for a scrupulous host.
Question: Explore how the location, type, and features of AirBnB listings are related to subway access. For this part, select a single neighborhood that lends itself to such an analysis (i.e. has multiple subway stations, different types of AirBnB listings etc.). If you feel ambitious you can complement this with an analysis of the entire city or an entire borough, but don’t get bogged down in analyzing 40,000 listings; focus on a single neighborhood.
You should decide what are some interesting questions and patterns to explore and map here. But please make sure to incorporate the following pieces of analysis:
Discussion: I took 250 meters distance between an AirBnB listing and a subway entrace to mean “close” for this map.
Discussion: I tried plotting the last plot using accommodates, property_type, bedrooms, review_scores_rating, and other variables, but all of the results were very similar, so I chose not to include them. It seems that access to subway entrances has a slight negative impact on the nightly price of AirBnB listings in Williamsburg. This may be because listings farther away from the subway could be coastline properties with nice views and might, therefore, cost more.
For this week, I broke down some of the code I used to explore the data and some initial (mostly unsuccessful for my needs) methods I tried for various parts of the exercise. I do think that we need much more instruction on subsetting data, as that is the actual timesink in these assignments and not the actual data visualization.
I also messed up on setting CRS coordinates and had to submit this assignment a day late. My original code for question 3 ran, but I modified the data loading code earlier in the markdown file in a way that my sp objects switched from projected to unprojected and rgeos functions stopped running. I tried very hard to figure it out, but could not do it in time on Monday, March 13. Over the next day, I set the CRS to an EPSG format measured in meters for New York City, and that seemed to fix the problem. I apologize for being late.
Some initial data exploration:
str(airbnb)
str(ny_boro, max.level = 2)
str(wlms_stops)
Some initial research on combining spatial layers and sorting data:
Condensing dataframes research:
by_neighborhood <- airbnb %>%
group_by(neighbourhood) %>%
summarise(avg_avail = mean(availability_365, na.rm = TRUE),
avg_price = mean(price_2, na.rm = TRUE),
counts = n())
by_neighborhood <- as.data.frame(by_neighborhood)
summary(by_neighborhood)
## neighbourhood avg_avail avg_price counts
## Length:200 Min. : 0.0 Min. : 38.00 Min. : 1.0
## Class :character 1st Qu.:142.8 1st Qu.: 78.16 1st Qu.: 6.0
## Mode :character Median :189.0 Median :100.20 Median : 20.5
## Mean :198.8 Mean :123.20 Mean : 201.1
## 3rd Qu.:243.5 3rd Qu.:146.84 3rd Qu.: 117.0
## Max. :365.0 Max. :700.00 Max. :6019.0
ny_neigh@data <- data.frame(ny_neigh@data, by_neighborhood[match(ny_neigh@data[,"neighbourhood"], by_neighborhood[,"neighbourhood"]),])
ny_neigh@data$counts
## [1] NA 8 8 NA 2 NA 24 20 8 6 NA NA NA 894
## [15] 6 32 68 117 NA NA 24 NA 2199 NA NA 10 44 3
## [29] NA 219 24 NA NA 25 NA 39 11 110 26 NA 1665 NA
## [43] NA 292 8 57 198 2 NA NA 823 21 NA NA 2 709
## [57] NA 53 6 1122 NA 2 25 24 13 52 2 1 NA NA
## [71] 31 2 NA 113 7 20 143 835 NA 4 1 82 NA 147
## [85] 989 6 6 NA NA NA 340 565 175 33 NA 134 115 84
## [99] 353 NA 3 4 NA 4 NA NA NA 9 28 115 NA 3
## [113] 1 797 358 5 1400 1313 12 NA NA NA 4 4 NA 2
## [127] 117 124 194 2 NA 10 358 NA 41 NA 9 203 161 3
## [141] 1009 11 9 332 87 11 2 6 3 35 5 17 6 1
## [155] 276 NA NA NA 4 2 5 3 NA 261 NA 628 17 8
## [169] NA NA NA 21 9 NA 305 7 47 36 54 NA 246 7
## [183] 22 NA 56 3 NA NA NA NA NA NA NA 101 9 10
## [197] NA NA 13 NA 11 29 15 NA 203 6 186 NA 4 2
## [211] 2 12 117 NA 5 92 NA 14 1226 1531 109 12 741 17
## [225] 2 24 6 662 NA 3 12 3327 NA
tm_shape(ny_neigh) +
tm_fill(col = "counts")
tm_shape(ny_neigh[138,]) +
tm_fill()
Exploration for question 2:
# Recode data
summary(airbnb$availability_365)
abnb_fullyear <- airbnb[which(airbnb$availability_365 == 365),]
summary(abnb_fullyear$availability_365)
abnb_notfullyear <- airbnb[which(airbnb$availability_365 != 365),]
summary(abnb_notfullyear$availability_365)
airbnb$price_2 = as.numeric(gsub("\\$", "", airbnb$price))
summary(airbnb$price_2)
airbnb$fullyear <- ifelse(airbnb$availability_365 == 365, 1, 0)
sum(airbnb$fullyear)
# Graph availability vs price information
ggplot(data = airbnb, aes(x = as.factor(airbnb$availability_365 == 365), y = price_2,
col = as.factor(airbnb$availability_365 == 365) == 1)) +
geom_boxplot(fill = "grey") +
scale_x_discrete(labels=c("Not Full Year","Full Year")) +
labs(x = "Availability of Listing",
y = "Nightly Price",
title = "Price difference between AirBnB listings\nthat are available year-round\nand those not available year round") +
ggthemes::theme_tufte() +
theme(legend.position = "none",
plot.title = element_text(hjust = 0.5, size = 24))
ggplot(data = airbnb, aes(x = as.factor(airbnb$availability_365 == 365), y = price_2*availability_365/12/10^6,
col = as.factor(airbnb$availability_365 == 365) == 1)) +
geom_bar(fill = "grey", stat = "identity") +
scale_x_discrete(labels=c("Not Full Year","Full Year")) +
labs(x = "Availability of Listing",
y = "Monthly Income from Listings (in millions)",
title = "Income difference between all AirBnB listings\nthat are available year-round\nand those not available year round") +
ggthemes::theme_tufte() +
theme(legend.position = "none",
plot.title = element_text(hjust = 0.5, size = 24))
ggplot(data = airbnb, aes(x = as.factor(airbnb$availability_365 == 365), y = price_2*availability_365/12,
col = as.factor(airbnb$availability_365 == 365) == 1)) +
stat_summary(fun.y="mean", geom="bar", fill = "#F8766D") +
scale_x_discrete(labels=c("Not Full Year","Full Year")) +
labs(x = "Availability of Listing",
y = "Monthly Income from Listing",
title = "Average monthly income difference\nbetween AirBnB listings\nthat are available year-round\nand those not available year round") +
ggthemes::theme_tufte() +
theme(legend.position = "none",
plot.title = element_text(hjust = 0.5, size = 24))
# Found base ggplot colors to match in the last plot by using ggplot_build()$data #F8766D
# Create a map of hotspots
ggplot() +
geom_polygon(data = ny_boro, aes(x = long, y = lat, group = group), fill = "darkgrey") +
geom_point(data = abnb_fullyear, aes(x = longitude, y = latitude), col = I("darkred"), size = .0001, size = 3) +
stat_density2d(aes(x = longitude,y = latitude,
fill = ..level.., alpha = ..level..),
data = airbnb, geom = 'polygon', bins = 12) +
scale_fill_gradient2(low = "white", mid="yellow", high = "red") +
scale_alpha(range = c(0.00, 0.5)) + theme(legend.position = "none") +
labs(title = "",
x = "", y = "") +
theme(plot.title = element_text(hjust = 0.5, size = 20),
axis.line=element_blank(),
axis.text=element_blank(),
axis.ticks=element_blank(),
axis.title=element_blank(),
panel.background=element_blank(),
panel.border=element_blank(),
panel.grid=element_blank(),
panel.margin=unit(0, "lines"),
plot.background=element_blank())
Identifying neighborhoods:
# pick one neighborhood
ny_neigh$neighbourhood
## [1] Bayswater City Island
## [3] Allerton Ditmars Steinway
## [5] Gerritsen Beach Port Ivory
## [7] Soundview Ozone Park
## [9] Fordham Whitestone
## [11] Arden Heights Arrochar
## [13] Arverne Astoria
## [15] Bath Beach Bayside
## [17] Battery Park City Bay Ridge
## [19] Bay Terrace Bay Terrace, Staten Island
## [21] Baychester Bayswater
## [23] Bedford-Stuyvesant Belle Harbor
## [25] Bellerose Belmont
## [27] Bensonhurst Bergen Beach
## [29] Bloomfield Boerum Hill
## [31] Borough Park Breezy Point
## [33] Briarwood Brighton Beach
## [35] Prospect-Lefferts Gardens Mott Haven
## [37] Bronxdale Brooklyn Heights
## [39] Brownsville Bull's Head
## [41] Bushwick Cambria Heights
## [43] Chelsea, Staten Island Chinatown
## [45] City Island Canarsie
## [47] Carroll Gardens Castle Hill
## [49] Castleton Corners Charleston
## [51] Chelsea Civic Center
## [53] Claremont Village Clason Point
## [55] Clifton Clinton Hill
## [57] Co-op City Cobble Hill
## [59] College Point Crown Heights
## [61] Columbia St Concord
## [63] Concourse Concourse Village
## [65] Coney Island Corona
## [67] Mount Eden Country Club
## [69] Mount Hope Cypress Hills
## [71] DUMBO Dongan Hills
## [73] Douglaston Downtown Brooklyn
## [75] Dyker Heights East Elmhurst
## [77] East Flatbush East Harlem
## [79] East Morrisania Eltingville
## [81] Emerson Hill Elmhurst
## [83] Fieldston East New York
## [85] East Village Eastchester
## [87] Edenwald Edgemere
## [89] Far Rockaway Jamaica Estates
## [91] Financial District Flatbush
## [93] Flatiron District Flatlands
## [95] Laurelton Flushing
## [97] Gowanus Forest Hills
## [99] Fort Greene Fort Hamilton
## [101] Fort Wadsworth Fresh Meadows
## [103] Gramercy Graniteville
## [105] Grant City Jamaica Hills
## [107] Glen Oaks Glendale
## [109] Gravesend Kensington
## [111] Kew Gardens Great Kills
## [113] Huguenot Greenpoint
## [115] Greenwich Village Grymes Hill
## [117] Harlem Hell's Kitchen
## [119] Highbridge Hollis
## [121] Hollis Hills Holliswood
## [123] Howard Beach Howard Beach
## [125] Howland Hook Hunts Point
## [127] Inwood Jackson Heights
## [129] Jamaica Morris Park
## [131] Kew Gardens Hills Kingsbridge
## [133] Kips Bay Lighthouse Hill
## [135] Little Italy Little Neck
## [137] Morrisania Murray Hill
## [139] Long Island City Longwood
## [141] Lower East Side Manhattan Beach
## [143] Marble Hill Midtown
## [145] Midwood Norwood
## [147] Oakwood Morris Heights
## [149] Mariners Harbor Maspeth
## [151] Melrose Middle Village
## [153] Midland Beach Mill Basin
## [155] Morningside Heights Olinville
## [157] Navy Yard Neponsit
## [159] New Brighton New Dorp
## [161] New Dorp Beach New Springville
## [163] NoHo Nolita
## [165] North Riverdale Park Slope
## [167] Parkchester Pelham Bay
## [169] Queens Village Pelham Gardens
## [171] Pleasant Plains Port Morris
## [173] Port Richmond Prince's Bay
## [175] Prospect Heights Randall Manor
## [177] Red Hook Rego Park
## [179] Richmond Hill Richmondtown
## [181] Ridgewood Sea Gate
## [183] Riverdale Rockaway Beach
## [185] Roosevelt Island Rosebank
## [187] Shore Acres Silver Lake
## [189] SoHo Woodrow
## [191] Rosedale Rossville
## [193] Schuylerville Sheepshead Bay
## [195] South Beach South Ozone Park
## [197] South Slope Springfield Gardens
## [199] Spuyten Duyvil St. Albans
## [201] Tompkinsville St. George
## [203] Stapleton Stuyvesant Town
## [205] Sunnyside Van Nest
## [207] Sunset Park Theater District
## [209] Throgs Neck Todt Hill
## [211] Tottenville Tremont
## [213] Tribeca Two Bridges
## [215] Vinegar Hill Woodside
## [217] Unionport University Heights
## [219] Upper East Side Upper West Side
## [221] Windsor Terrace Wakefield
## [223] Washington Heights West Brighton
## [225] West Farms Woodhaven
## [227] Woodlawn West Village
## [229] Westchester Square Westerleigh
## [231] Williamsbridge Williamsburg
## [233] Willowbrook
## 230 Levels: Allerton Arden Heights Arrochar Arverne Astoria ... Woodside
# select Williamsburg
Williamsburg_n <- 232
Spatial join code research:
summary(ny_neigh, max.level = 2)
## Object of class SpatialPolygonsDataFrame
## Coordinates:
## min max
## x -74.25559 -73.70782
## y 40.49613 40.91553
## Is projected: FALSE
## proj4string :
## [+proj=longlat +datum=NAD83 +ellps=GRS80 +towgs84=0,0,0]
## Data attributes:
## neighbourhood neighbourhood_group neighbourhood.1
## Bayswater : 2 Bronx :50 Length:233
## City Island : 2 Brooklyn :48 Class :character
## Howard Beach : 2 Manhattan :32 Mode :character
## Allerton : 1 Queens :55
## Arden Heights: 1 Staten Island:48
## Arrochar : 1
## (Other) :224
## avg_avail avg_price counts
## Min. : 0.0 Min. : 38.00 Min. : 1.0
## 1st Qu.:144.4 1st Qu.: 78.07 1st Qu.: 6.0
## Median :189.2 Median : 99.09 Median : 21.5
## Mean :199.0 Mean :119.54 Mean : 190.8
## 3rd Qu.:243.5 3rd Qu.:134.95 3rd Qu.: 126.5
## Max. :365.0 Max. :700.00 Max. :3327.0
## NA's :73 NA's :73 NA's :73
summary(airbnb.df)
## Object of class SpatialPointsDataFrame
## Coordinates:
## min max
## longitude -74.24084 -73.71175
## latitude 40.49979 40.91477
## Is projected: FALSE
## proj4string :
## [+proj=longlat +datum=NAD83 +ellps=GRS80 +towgs84=0,0,0]
## Number of points: 40227
## Data attributes:
## id listing_url scrape_id
## Min. : 2515 Length:40227 Min. :2.016e+13
## 1st Qu.: 4549554 Class :character 1st Qu.:2.016e+13
## Median : 9241956 Mode :character Median :2.016e+13
## Mean : 8837834 Mean :2.016e+13
## 3rd Qu.:13548618 3rd Qu.:2.016e+13
## Max. :16224408 Max. :2.016e+13
##
## last_scraped name summary
## Min. :2016-12-03 Length:40227 Length:40227
## 1st Qu.:2016-12-03 Class :character Class :character
## Median :2016-12-03 Mode :character Mode :character
## Mean :2016-12-03
## 3rd Qu.:2016-12-04
## Max. :2016-12-04
##
## space description experiences_offered
## Length:40227 Length:40227 Length:40227
## Class :character Class :character Class :character
## Mode :character Mode :character Mode :character
##
##
##
##
## neighborhood_overview notes transit
## Length:40227 Length:40227 Length:40227
## Class :character Class :character Class :character
## Mode :character Mode :character Mode :character
##
##
##
##
## access interaction house_rules
## Length:40227 Length:40227 Length:40227
## Class :character Class :character Class :character
## Mode :character Mode :character Mode :character
##
##
##
##
## thumbnail_url medium_url picture_url
## Length:40227 Length:40227 Length:40227
## Class :character Class :character Class :character
## Mode :character Mode :character Mode :character
##
##
##
##
## xl_picture_url host_id host_url
## Length:40227 Min. : 43 Length:40227
## Class :character 1st Qu.: 4367256 Class :character
## Mode :character Median : 16436747 Mode :character
## Mean : 26681550
## 3rd Qu.: 41758326
## Max. :105988052
##
## host_name host_since host_location
## Length:40227 Min. :2008-03-03 Length:40227
## Class :character 1st Qu.:2012-12-10 Class :character
## Mode :character Median :2014-06-10 Mode :character
## Mean :2014-03-21
## 3rd Qu.:2015-08-21
## Max. :2016-12-03
## NA's :31
## host_about host_response_time host_response_rate
## Length:40227 Length:40227 Length:40227
## Class :character Class :character Class :character
## Mode :character Mode :character Mode :character
##
##
##
##
## host_acceptance_rate host_is_superhost host_thumbnail_url
## Length:40227 Length:40227 Length:40227
## Class :character Class :character Class :character
## Mode :character Mode :character Mode :character
##
##
##
##
## host_picture_url host_neighbourhood host_listings_count
## Length:40227 Length:40227 Min. : 0.000
## Class :character Class :character 1st Qu.: 1.000
## Mode :character Mode :character Median : 1.000
## Mean : 2.229
## 3rd Qu.: 2.000
## Max. :777.000
## NA's :31
## host_total_listings_count host_verifications host_has_profile_pic
## Min. : 0.000 Length:40227 Length:40227
## 1st Qu.: 1.000 Class :character Class :character
## Median : 1.000 Mode :character Mode :character
## Mean : 2.229
## 3rd Qu.: 2.000
## Max. :777.000
## NA's :31
## host_identity_verified street neighbourhood
## Length:40227 Length:40227 Length:40227
## Class :character Class :character Class :character
## Mode :character Mode :character Mode :character
##
##
##
##
## neighbourhood_cleansed neighbourhood_group_cleansed city
## Length:40227 Length:40227 Length:40227
## Class :character Class :character Class :character
## Mode :character Mode :character Mode :character
##
##
##
##
## state zipcode market smart_location
## Length:40227 Min. : 5340 Length:40227 Length:40227
## Class :character 1st Qu.:10022 Class :character Class :character
## Mode :character Median :10475 Mode :character Mode :character
## Mean :10637
## 3rd Qu.:11218
## Max. :99135
## NA's :593
## country_code country latitude longitude
## Length:40227 Length:40227 Min. :40.50 Min. :-74.24
## Class :character Class :character 1st Qu.:40.69 1st Qu.:-73.98
## Mode :character Mode :character Median :40.72 Median :-73.96
## Mean :40.73 Mean :-73.96
## 3rd Qu.:40.76 3rd Qu.:-73.94
## Max. :40.91 Max. :-73.71
##
## is_location_exact property_type room_type accommodates
## Length:40227 Length:40227 Length:40227 Min. : 1.00
## Class :character Class :character Class :character 1st Qu.: 2.00
## Mode :character Mode :character Mode :character Median : 2.00
## Mean : 2.79
## 3rd Qu.: 4.00
## Max. :16.00
##
## bathrooms bedrooms beds bed_type
## Min. :0.000 Min. :0.000 Min. : 1.000 Length:40227
## 1st Qu.:1.000 1st Qu.:1.000 1st Qu.: 1.000 Class :character
## Median :1.000 Median :1.000 Median : 1.000 Mode :character
## Mean :1.123 Mean :1.131 Mean : 1.521
## 3rd Qu.:1.000 3rd Qu.:1.000 3rd Qu.: 2.000
## Max. :8.000 Max. :9.000 Max. :16.000
## NA's :186 NA's :57 NA's :69
## amenities square_feet price
## Length:40227 Min. : 0.0 Length:40227
## Class :character 1st Qu.: 250.0 Class :character
## Mode :character Median : 650.0 Mode :character
## Mean : 723.2
## 3rd Qu.: 900.0
## Max. :10118.0
## NA's :39609
## weekly_price monthly_price security_deposit
## Length:40227 Length:40227 Length:40227
## Class :character Class :character Class :character
## Mode :character Mode :character Mode :character
##
##
##
##
## cleaning_fee guests_included extra_people minimum_nights
## Length:40227 Min. : 0.000 Length:40227 Min. : 1.00
## Class :character 1st Qu.: 1.000 Class :character 1st Qu.: 1.00
## Mode :character Median : 1.000 Mode :character Median : 2.00
## Mean : 1.427 Mean : 3.71
## 3rd Qu.: 2.000 3rd Qu.: 3.00
## Max. :16.000 Max. :1250.00
##
## maximum_nights calendar_updated has_availability
## Min. :1.000e+00 Length:40227 Length:40227
## 1st Qu.:3.000e+01 Class :character Class :character
## Median :1.125e+03 Mode :character Mode :character
## Mean :2.272e+05
## 3rd Qu.:1.125e+03
## Max. :2.147e+09
##
## availability_30 availability_60 availability_90 availability_365
## Min. : 0.000 Min. : 0.00 Min. : 0.00 Min. : 0.0
## 1st Qu.: 0.000 1st Qu.: 0.00 1st Qu.: 0.00 1st Qu.: 0.0
## Median : 5.000 Median :23.00 Median :42.00 Median : 91.0
## Mean : 9.184 Mean :23.89 Mean :40.07 Mean :155.6
## 3rd Qu.:17.000 3rd Qu.:43.00 3rd Qu.:72.00 3rd Qu.:333.0
## Max. :30.000 Max. :60.00 Max. :90.00 Max. :365.0
##
## calendar_last_scraped number_of_reviews first_review
## Min. :2016-12-03 Min. : 0.00 Min. :2008-10-13
## 1st Qu.:2016-12-03 1st Qu.: 1.00 1st Qu.:2015-01-04
## Median :2016-12-03 Median : 4.00 Median :2015-12-10
## Mean :2016-12-03 Mean : 15.27 Mean :2015-07-23
## 3rd Qu.:2016-12-03 3rd Qu.: 17.00 3rd Qu.:2016-07-12
## Max. :2016-12-04 Max. :380.00 Max. :2016-12-03
## NA's :9077
## last_review review_scores_rating review_scores_accuracy
## Min. :2010-06-15 Min. : 20.00 Min. : 2.000
## 1st Qu.:2016-07-30 1st Qu.: 90.00 1st Qu.: 9.000
## Median :2016-10-24 Median : 95.00 Median :10.000
## Mean :2016-08-07 Mean : 92.55 Mean : 9.495
## 3rd Qu.:2016-11-16 3rd Qu.:100.00 3rd Qu.:10.000
## Max. :2016-12-03 Max. :100.00 Max. :10.000
## NA's :9030 NA's :9807 NA's :9890
## review_scores_cleanliness review_scores_checkin
## Min. : 2.000 Min. : 2.000
## 1st Qu.: 9.000 1st Qu.:10.000
## Median : 9.000 Median :10.000
## Mean : 9.159 Mean : 9.671
## 3rd Qu.:10.000 3rd Qu.:10.000
## Max. :10.000 Max. :10.000
## NA's :9864 NA's :9984
## review_scores_communication review_scores_location review_scores_value
## Min. : 2.000 Min. : 2.000 Min. : 2.000
## 1st Qu.:10.000 1st Qu.: 9.000 1st Qu.: 9.000
## Median :10.000 Median :10.000 Median : 9.000
## Mean : 9.717 Mean : 9.382 Mean : 9.286
## 3rd Qu.:10.000 3rd Qu.:10.000 3rd Qu.:10.000
## Max. :10.000 Max. :10.000 Max. :10.000
## NA's :9857 NA's :9978 NA's :9977
## requires_license license jurisdiction_names
## Length:40227 Length:40227 Length:40227
## Class :character Class :character Class :character
## Mode :character Mode :character Mode :character
##
##
##
##
## instant_bookable cancellation_policy require_guest_profile_picture
## Length:40227 Length:40227 Length:40227
## Class :character Class :character Class :character
## Mode :character Mode :character Mode :character
##
##
##
##
## require_guest_phone_verification calculated_host_listings_count
## Length:40227 Min. : 1.000
## Class :character 1st Qu.: 1.000
## Mode :character Median : 1.000
## Mean : 1.711
## 3rd Qu.: 2.000
## Max. :33.000
##
## reviews_per_month
## Min. : 0.010
## 1st Qu.: 0.330
## Median : 0.920
## Mean : 1.422
## 3rd Qu.: 2.080
## Max. :14.560
## NA's :9077
Murray_Hill <- ny_neigh[138,]
summary(Murray_Hill, max.level = 2)
## Object of class SpatialPolygonsDataFrame
## Coordinates:
## min max
## x -73.98296 -73.96792
## y 40.74304 40.75280
## Is projected: FALSE
## proj4string :
## [+proj=longlat +datum=NAD83 +ellps=GRS80 +towgs84=0,0,0]
## Data attributes:
## neighbourhood neighbourhood_group neighbourhood.1
## Murray Hill :1 Bronx :0 Length:1
## Allerton :0 Brooklyn :0 Class :character
## Arden Heights:0 Manhattan :1 Mode :character
## Arrochar :0 Queens :0
## Arverne :0 Staten Island:0
## Astoria :0
## (Other) :0
## avg_avail avg_price counts
## Min. :128 Min. :183.1 Min. :203
## 1st Qu.:128 1st Qu.:183.1 1st Qu.:203
## Median :128 Median :183.1 Median :203
## Mean :128 Mean :183.1 Mean :203
## 3rd Qu.:128 3rd Qu.:183.1 3rd Qu.:203
## Max. :128 Max. :183.1 Max. :203
##
Murray_Hill <- spTransform(Murray_Hill, CRS(proj4string(ny_boro)))
airbnb.df <- spTransform(airbnb.df, CRS(proj4string(ny_boro)))
airbnb_murray <- airbnb.df[Murray_Hill,]
tm_shape(ny_neigh[138,]) +
tm_borders() + tm_fill() +
tm_shape(airbnb_murray) +
tm_dots()
Find EPSG code for NAD83:
EPSG <-make_EPSG() # create data frame of available EPSG codes
EPSG[grepl("NAD83$", EPSG$note), ] # "+init=epsg:4269"
## code note prj4
## 198 4269 # NAD83 +proj=longlat +datum=NAD83 +no_defs