Here are my codes, error was in adding
polygon
library(leaflet) # mapping
library(sf) # for spatial data analysis
library(tidyverse)
library(ggplot2)
library(tmap)
library(dplyr)
library(readxl)
```
## Import the csv with the coordinates and records
```{r}
Village_GPS4 <- read_csv("C:/Users/Admin/Downloads/Village_GPS4.csv")
```
```{r}
```
## Read the Kenya shapefile with county adminstrative boundaries
The *st_layers()* function list all layer names and their type in a data source
```{r}
minboundaries_tabulardata <- st_layers("C:/Users/Admin/Downloads/ken_adminboundaries_tabulardata.xlsx")
```
## Visualize point in polygon
Adding circle markers to the Kenya map.
```{r, fig.width = 10, fig.height = 5}
map <- leaflet() %>%
addTiles() %>%
setView(lng = 37, lat = 0.3, zoom = 6) %>%
addPolygons(data = minboundaries_tabulardata$geometry,
Color = "green",
weight = 2,
opacity = 1
) %>%
addCircleMarkers
lng =longititude$species,
lat = latitude$species,
radius = 5,
weight = 3,
color = "black")
map