library(tidyverse)
## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
## ✔ dplyr     1.1.4     ✔ readr     2.1.5
## ✔ forcats   1.0.0     ✔ stringr   1.5.1
## ✔ ggplot2   3.4.4     ✔ tibble    3.2.1
## ✔ lubridate 1.9.3     ✔ tidyr     1.3.1
## ✔ purrr     1.0.2     
## ── 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(viridis)
## Loading required package: viridisLite
library(mapdata)
## Warning: package 'mapdata' was built under R version 4.3.3
## Loading required package: maps
## 
## Attaching package: 'maps'
## 
## The following object is masked from 'package:viridis':
## 
##     unemp
## 
## The following object is masked from 'package:purrr':
## 
##     map
#Load
data <- read.table("https://raw.githubusercontent.com/holtzy/data_to_viz/master/Example_dataset/17_ListGPSCoordinates.csv", sep=",", header=T)

# plot
data %>%
  filter(homecontinent=='Europe') %>%
  ggplot(aes(x=homelon, y=homelat)) + 
  geom_hex() +
  xlim(-30, 70) +ylim(24, 72) +
  scale_fill_viridis(option="D", trans = "log", name="Scale") +
  labs(title="HexBin Map of europe - 21MIC0065", x="Longtitude", y="Latitude")
## Warning: Removed 519 rows containing non-finite values (`stat_binhex()`).