#mapping section load the below libraries
library(ggplot2)
## Warning: package 'ggplot2' was built under R version 4.4.1
library(leaflet)
library(tidyverse)
## Warning: package 'tibble' was built under R version 4.4.1
## Warning: package 'purrr' was built under R version 4.4.1
## Warning: package 'lubridate' was built under R version 4.4.1
## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
## ✔ dplyr     1.1.4     ✔ readr     2.1.5
## ✔ forcats   1.0.0     ✔ stringr   1.5.1
## ✔ lubridate 1.9.4     ✔ tibble    3.3.0
## ✔ purrr     1.1.0     ✔ tidyr     1.3.1
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag()    masks stats::lag()
## ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
library(dplyr)

pelicount <- read.csv("/Users/pennybeaver/Library/Mobile Documents/com~apple~CloudDocs/COAST/Pelicount/Pelicount counts.csv")

#convert lat and lon to numbers
pelicount$lat <- as.numeric(pelicount$lat)
## Warning: NAs introduced by coercion
library(htmltools)
library(glue)
## Warning: package 'glue' was built under R version 4.4.1
label_text <- glue("<b>Number of Pelicans: <b> {pelicount$no_pelicans}<b>")

#create the final map
leaflet(pelicount) %>% addTiles() %>%
  addCircleMarkers(~lng, ~lat, radius = 5, color = "purple", fillOpacity = 0.3, label = pelicount$no_pelicans, popup = label_text)
## Warning in validateCoords(lng, lat, funcName): Data contains 1 rows with either
## missing or invalid lat/lon values and will be ignored
#Map of Australian pelican's counted in July 2025 for a citizen science project managed by COAST.You can scroll in and out and hover over purple points to get the number of pelicans counted in that location.

….