0

I'm relatively new to R, so any imput would be greatly appreciated. The code I'm writing is about graphing certain spanich cedar populations across America. I was able to export a map using ggmap, and although the map can be visualized, the function geom_point is not displaying the data exported from an Excel. The Excel doc has the latitude and longitude for the location of each population, and I would like it to apper in the map with a dot.

This is my code so far:

knitr::opts_chunk$set(echo = TRUE, message = FALSE, warning = FALSE)
library(tidyverse)
library(googlesheets4)
library(openintro)
library(maps)
library(ggmap)
library(ggplot2)
library(ggthemes)
gs4_deauth()
theme_set(theme_minimal())
map_americas <- get_stamenmap(
  bbox = c(left = -101, bottom = 10, right = -81, top = 21), 
  maptype = "terrain",
  zoom = 6
)

ggmap(map_americas) + 
  geom_point(data = data_map, 
             aes(x = lat, y = lon, color = Ho), 
             size = 5) +
  theme_map()
  

And this is the messege I receive back after running it:

Warning message:
Removed 33 rows containing missing values (geom_point). 

Thank you!

Ana
  • 1
  • 1
  • 2
    It's easier to help you if you include a simple [reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) with sample input and desired output that can be used to test and verify possible solutions. If we can't run the code it's kind of hard to tell what's going on. – MrFlick Sep 14 '21 at 02:52
  • Please provide enough code so others can better understand or reproduce the problem. – Community Sep 14 '21 at 13:49

0 Answers0