Downloaded data from USA Reference
#Reading data from downloaded file
grocery_store <- read.csv("grocery_store.csv",sep=",",header=T)
grocery_store <- grocery_store[,-1]
# Selecting columns from main table, required for our data table
req_grocery_store <- subset(grocery_store,
select=c(Company.Name,Address,City,State,ZIP.Code,Phone.Number.Combined,Primary.SIC.Code,Primary.SIC.Description,SIC.Code.1,SIC.Code.1.Description,Latitude,Longitude))
str(req_grocery_store)
## 'data.frame': 1169 obs. of 12 variables:
## $ Company.Name : Factor w/ 693 levels "3 M S Enterprises LLC",..: 1 2 3 4 5 6 7 8 9 10 ...
## $ Address : Factor w/ 1109 levels "","1 Wake Forest Rd Res",..: 494 37 783 905 547 453 184 852 901 95 ...
## $ City : Factor w/ 32 levels "Angier","Apex",..: 23 17 26 23 23 26 2 2 5 26 ...
## $ State : Factor w/ 1 level "NC": 1 1 1 1 1 1 1 1 1 1 ...
## $ ZIP.Code : int 27604 27545 27576 27612 27603 27576 27502 27502 27511 27576 ...
## $ Phone.Number.Combined : Factor w/ 1105 levels "(504) 581-6612",..: 752 104 1073 719 67 7 210 158 272 1023 ...
## $ Primary.SIC.Code : int 541103 545102 541103 554101 541105 554101 541105 554101 541105 874130 ...
## $ Primary.SIC.Description: Factor w/ 55 levels "Accountants",..: 9 55 9 44 26 44 26 44 26 32 ...
## $ SIC.Code.1 : int 541103 545102 541103 541103 541105 541103 541103 541103 541105 541103 ...
## $ SIC.Code.1.Description : Factor w/ 58 levels "Brewers (Mfrs)",..: 5 58 5 5 26 5 5 5 26 5 ...
## $ Latitude : num 35.8 35.8 35.6 35.9 35.7 ...
## $ Longitude : num -78.6 -78.5 -78.3 -78.7 -78.7 ...
summary(req_grocery_store)
## Company.Name Address City
## Food Lion : 76 : 2 Raleigh :377
## Kangaroo Express : 48 100 W Woodcroft Pkwy: 2 Durham :221
## Han-Dee Hugo's : 45 1001 S Miami Blvd : 2 Cary : 85
## Harris Teeter : 40 1007 N Miami Blvd : 2 Chapel Hill: 43
## Sheetz : 22 101 Reed St : 2 Wake Forest: 43
## Walmart Supercenter: 20 102 S 1st Ave : 2 Garner : 42
## (Other) :918 (Other) :1157 (Other) :358
## State ZIP.Code Phone.Number.Combined Primary.SIC.Code
## NC:1169 Min. :27243 Not Available : 8 Min. : 75211
## 1st Qu.:27529 (919) 878-9377: 3 1st Qu.:541103
## Median :27603 (919) 207-0800: 2 Median :541105
## Mean :27588 (919) 217-0479: 2 Mean :545778
## 3rd Qu.:27615 (919) 217-6850: 2 3rd Qu.:545102
## Max. :28334 (919) 231-0201: 2 Max. :874130
## (Other) :1150
## Primary.SIC.Description SIC.Code.1
## Grocers-Retail :366 Min. : 72311
## Convenience Stores :354 1st Qu.:541103
## Service Stations-Gasoline & Oil:213 Median :541103
## Department Stores : 42 Mean :529505
## Yogurt : 41 3rd Qu.:541105
## Food Products-Retail : 34 Max. :545102
## (Other) :119
## SIC.Code.1.Description Latitude Longitude
## Convenience Stores :561 Min. :35.32 Min. :-79.30
## Grocers-Retail :300 1st Qu.:35.74 1st Qu.:-78.87
## Food Markets : 64 Median :35.82 Median :-78.68
## Yogurt : 53 Mean :35.81 Mean :-78.70
## Food Products-Retail: 40 3rd Qu.:35.93 3rd Qu.:-78.57
## Department Stores : 35 Max. :36.22 Max. :-78.13
## (Other) :116