Geomarketing with R

This tutorial is a basic geomarketing application developed using R and the Leaflet package available in the R environment. You’ll be able to develop a basic interactive map and get it embedded to your own web repository for geomarketing purposes.

## Data source:

We will be using the free data source available from the ArcGis site. https://www.arcgis.com/home/item.html?id=ce74fe1059ea4d57b34a7adda66d361a

Please keep in mind that this dataset was captured before 2014.

References

How Big Data Helps Chains Like Starbucks Pick Store Locations – An (Unsung) Key To Retail Success https://www.forbes.com/sites/barbarathau/2014/04/24/how-big-data-helps-retailers-like-starbucks-pick-store-locations-an-unsung-key-to-retail-success/#3bf7e28016db

A tale of two site planning strategies: Dunkin’ Donuts versus Starbucks https://carto.com/blog/updated-site-selection-and-investment-planning/

Space and Place in Business Intelligence: A Case Study of Starbucks Coffee Company in Central Ohio https://etd.ohiolink.edu/!etd.send_file?accession=osu1337784621

#Technical references https://github.com/mtennekes/tmap https://rstudio.github.io/leaflet/

What is required?

No prior knowledge is required. However, understanding how to use RStudio is critical for you to get started.

Why is this important?

Geomarketing describes “any form of marketing that incorporates location intelligence in order to improve the odda of a particular message reaching the right consumer at the right time.” You could “examining the power of location’s influence on marketing — and how ad campaigns with a”geo" component drive more foot traffic to stores."

https://geomarketing.com/ Chapter 15 Working with spatial data - https://beanumber.github.io/mdsr2e/ch-spatial.html

The following two R packages will be required:

“leaflet” “tidyverse”

Make sure to remove the # if you have never used leaflet and tidyverse before:

## Warning: package 'leaflet' was built under R version 3.6.3
## Warning: package 'tidyverse' was built under R version 3.6.3
## -- Attaching packages -------------------------------------- tidyverse 1.3.0 --
## v ggplot2 3.2.1     v purrr   0.3.3
## v tibble  2.1.3     v dplyr   0.8.4
## v tidyr   1.0.2     v stringr 1.4.0
## v readr   1.3.1     v forcats 0.5.0
## Warning: package 'readr' was built under R version 3.6.3
## Warning: package 'forcats' was built under R version 3.6.3
## -- Conflicts ----------------------------------------- tidyverse_conflicts() --
## x dplyr::filter() masks stats::filter()
## x dplyr::lag()    masks stats::lag()

Part 1 - Warm-up activity - Mapping my own location:

Find your own longitude and lantitude data here:

http://www.lat-long.com/Latitude-Longitude-1652668-California-Bakersfield.html

Part 2 - Geomarketing - Visualizing and Understanding Dunkin’ Donuts’ Location strategy

## Warning: package 'DT' was built under R version 3.6.3

Let’s find future areas for new store expansions

Assume that the Dunkin’ Donuts Inc. would have chosen UC Los Angles for test marketing. Here, we will identify an area for marketing strategic analysis. Rectangles are added using the addRectangles() function. It takes lng1, lng2, lat1, and lat2 vector arguments that define the corners of the rectangles. These arguments are always required; the rectangle geometry cannot be inferred from the data object.

Why do we use “echo=FALSE?”

Note that the echo = FALSE parameter was added to the code chunk to prevent printing of the R code that generated the plot.