Introduction

Leaflet peer review This is an Airbnb data set about NYC rental on Kaggle

read data

library(leaflet)
## Warning: package 'leaflet' was built under R version 3.5.2
data=read.csv("C:/Users/soviv/Downloads/scoringData.csv")

Data Preprocessing

I only select geo info and city and reviews as variables

library(dplyr);library(plyr)
## 
## 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
## -------------------------------------------------------------------------
## You have loaded plyr after dplyr - this is likely to cause problems.
## If you need functions from both plyr and dplyr, please load plyr first, then dplyr:
## library(plyr); library(dplyr)
## -------------------------------------------------------------------------
## 
## Attaching package: 'plyr'
## The following objects are masked from 'package:dplyr':
## 
##     arrange, count, desc, failwith, id, mutate, rename, summarise,
##     summarize
data<-data %>%dplyr::select(city,number_of_reviews,longitude,latitude,zipcode)%>%filter(!is.na(longitude),!is.na(latitude))

Maps- in New York city only excluding Queens and lic

data<-data%>%filter(city=='New York')
lat<-median(data$latitude)
lon<-median(data$longitude)

data %>%
  leaflet(options = leafletOptions(
                    
                     dragging = TRUE))  %>%
  addTiles()%>%
  addMarkers(label=~city)%>%
  setView(lng =lon, lat=lat, zoom = 6)
## Assuming "longitude" and "latitude" are longitude and latitude, respectively

Making Markers on top reviewed ones

highrating<-data%>%filter(number_of_reviews>150)

highrating %>%
  leaflet(options = leafletOptions(
                    
                     dragging = TRUE))  %>%
  addTiles()%>%
  addCircleMarkers(radius=2)
## Assuming "longitude" and "latitude" are longitude and latitude, respectively