All warehouses in the USA

plotly::plot_ly(data = geo_usa_4, x = ~area_m2, y = ~m2_price) %>%
layout(xaxis = list(title = "Warehouse area"),
       yaxis = list(title = "price per square meter per month"))

## Boxplot USA

plot_ly(geo_usa_4, x = ~m2_price, y = ~area_m2) %>%
  add_boxplot(color = ~county) %>%
  layout(xaxis = list(title = "Warehouse area"),
         yaxis = list(title = "price per square meter per month"))

Denver warehouses

library(dplyr)
geo_usa_5 <- geo_usa_4 %>%
  dplyr::filter(county == "denver") 

plotly::plot_ly(data = geo_usa_5, x = ~area_m2, y = ~m2_price) %>%
layout(xaxis = list(title = "Warehouse area"),
         yaxis = list(title = "price per square meter per month"))

Boxplot Denver

plot_ly(geo_usa_5, x = ~m2_price, y = ~area_m2) %>%
  add_boxplot(color = ~county) %>%
  layout(xaxis = list(title = "Warehouse area"),
         yaxis = list(title = "price per square meter per month"))

Location of warehouses (needs checking)

library(plotly)
df <- geo_usa_4

# geo styling
g <- list(
  scope = 'usa',
 projection = list(type = 'albers usa'),
  showland = TRUE,
  showlakes = FALSE,
  landcolor = toRGB("gray95"),
  subunitcolor = toRGB("gray85"),
  countrycolor = toRGB("gray85"),
  countrywidth = 0.5,
  subunitwidth = 0.5
)

fig <- plot_geo(df, lat = ~long, lon = ~lat)
fig <- fig %>% add_markers(
    text = ~paste(paste("Price:", m2_price), sep = "<br />"),
    color = ~m2_price, symbol = I("square"), size = I(8), hoverinfo = "text"
  )
fig <- fig %>% colorbar(title = "Price<br />")
fig <- fig %>% layout(
    title = 'Warehouse price ($/m2/mo)<br />', geo = g
  )

fig