Need help here. I am trying to create a new column that will list the number of restaurants with in 200 meters of a restaurant using latitude and longitude. I couldn't find anything on stackoverflow, and I am no R ninja. Any help would be appreciated!
head()
business_id restaurantType full_address open city 1 --5jkZ3-nUPZxUvtcbr8Uw Greek 1336 N Scottsdale Rd\nScottsdale, AZ 85257 1 Scottsdale 2 --BlvDO_RG2yElKu9XA1_g Sushi Bars 14870 N Northsight Blvd\nSte 103\nScottsdale, AZ 85260 1 Scottsdale 3 -_Ke8q969OAwEE_-U0qUjw Beer, Wine & Spirits 18555 N 59th Ave\nGlendale, AZ 85308 0 Glendale 4 -_npP9XdyzILAjtFfX8UAQ Vietnamese 6025 N 27th Avenue\nSte 24\nPhoenix, AZ 85073 1 Phoenix 5 -2xCV0XGD9NxfWaVwA1-DQ Pizza 9008 N 99th Ave\nPeoria, AZ 85345 1 Peoria 6 -3WVw1TNQbPBzaKCaQQ1AQ Chinese 302 E Flower St\nPhoenix, AZ 85012 1 Phoenix review_count name longitude state stars latitude type categories1 categories2 1 11 George's Gyros Greek Grill -111.9269 AZ 4.5 33.46337 business Greek <NA> 2 37 Asian Island -111.8983 AZ 4.0 33.62146 business Sushi Bars Hawaiian 3 6 Jug 'n Barrel Wine Shop -112.1863 AZ 4.5 33.65387 business <NA> Beer, Wine & Spirits 4 15 Thao's Sandwiches -112.0739 AZ 3.0 33.44990 business Vietnamese Sandwiches 5 4 Nino's Pizzeria 2 -112.2766 AZ 4.0 33.56626 business Pizza <NA> 6 145 China Chili -112.0692 AZ 3.5 33.48585 business Chinese <NA> avgStar duration delta 1 3.694030 381 0 2 3.661017 690 0 3 3.555556 604 1 4 3.577778 1916 0 5 3.482036 226 0 6 3.535928 2190 0
str()
'data.frame': 2833 obs. of 28 variables: $ business_id : Factor w/ 2833 levels "--5jkZ3-nUPZxUvtcbr8Uw",..: 1 2 3 4 5 6 7 8 9 10 ... $ restaurantType: Factor w/ 118 levels "Afghan","African",..: 60 106 15 117 89 31 17 7 84 31 ... $ full_address : Factor w/ 2586 levels "1 E Jackson St\nPhoenix, AZ 85004",..: 274 371 642 1825 2368 1102 1000 1143 2169 1669 ... $ open : int 1 1 0 1 1 1 1 1 1 1 ... $ city : Factor w/ 44 levels "Ahwatukee","Anthem",..: 34 34 19 31 30 31 34 4 18 31 ... $ review_count : int 11 37 6 15 4 145 255 35 7 7 ... $ name : Factor w/ 2652 levels "#1 Brother's Pizza",..: 885 127 1167 2318 1601 453 591 697 1492 1319 ... $ longitude : num -112 -112 -112 -112 -112 ... $ state : Factor w/ 2 levels "AZ","SC": 1 1 1 1 1 1 1 1 1 1 ... $ stars : num 4.5 4 4.5 3 4 3.5 4.5 4 2.5 4.5 ... $ latitude : num 33.5 33.6 33.7 33.4 33.6 ... $ type : Factor w/ 1 level "business": 1 1 1 1 1 1 1 1 1 1 ... $ categories1 : Factor w/ 103 levels "Afghan","African",..: 50 93 NA 102 78 26 14 7 73 26 ... $ Freq : int 66 58 8 44 166 166 98 35 45 166 ... $ avgRev : num 31.3 68.6 34.3 63.2 30.8 ... $ avgStar : num 3.69 3.66 3.56 3.58 3.48 ... $ duration : int 381 690 604 1916 226 2190 1968 1338 1606 56 ...