Hot spot analysis

62 views
Skip to first unread message

AMOS NYAMAO

unread,
Jul 26, 2022, 8:05:19 AM7/26/22
to Shiny - Web Framework for R
Hello, please help me create species hot spot in the kenya map. Attached is the data and shapefiles to use. Thank you
ken_adminboundaries_tabulardata (1).xlsx
Village_GPS4.csv

AMOS NYAMAO

unread,
Jul 26, 2022, 8:09:12 AM7/26/22
to Shiny - Web Framework for R
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

AMOS NYAMAO

unread,
Jul 28, 2022, 3:28:26 AM7/28/22
to Shiny - Web Framework for R
Any solution 

--
You received this message because you are subscribed to the Google Groups "Shiny - Web Framework for R" group.
To unsubscribe from this group and stop receiving emails from it, send an email to shiny-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/shiny-discuss/67111701-776e-421c-8ea0-0faa1286b3d0n%40googlegroups.com.

Samuel Mandillah

unread,
Oct 10, 2022, 4:44:29 AM10/10/22
to Shiny - Web Framework for R
https://rpubs.com/mandillah/953974 


Check the solution to this here. 

Reply all
Reply to author
Forward
0 new messages