R - Fitting a grid over a City Map and inputting data into grid squares
I'm trying to place a grid over San Jose like this: Grid of San Jose You can make the grid visually using the following code: ca_cities = tigris::places(state = "CA") #using tigris package to get shape file of all CA cities sj = ca_cities[ca_cities$NAME == "San Jose",] #specifying to San Jose UTM_ZONE = "10" #the UTM zone for San Jose, will be used to convert the proj4string of sj into UTM main_sj = sj@polygons[[1]]@Polygons[[5]] #the portion of the shape file I focus on. This is the boundary of san jose #converting the main_sj polygon into a spatialpolygondataframe using the sp package tst_ps