Skip to content

Commit

Permalink
Update lab-05.qmd
Browse files Browse the repository at this point in the history
  • Loading branch information
KodzuKenma101 authored Oct 4, 2024
1 parent 66d7902 commit a06d80b
Showing 1 changed file with 0 additions and 18 deletions.
18 changes: 0 additions & 18 deletions lab-05.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ met1[, euc := sqrt(
)]
staterep <- met1[order(euc, lat), .SD[1], by = STATE]
staterep$datanum <- 1
staterep[order(STATE)]
```

Expand Down Expand Up @@ -152,27 +151,10 @@ met2[, euc2 := sqrt(
)]
centerstation <- met2[order(euc2), .SD[1], by = STATE]
centerstation$datanum <- 2
centerstation[order(STATE)]
mapdata <- merge(staterep, centerstation, by = "datanum", all = TRUE)
mapdata
library(leaflet)
mapdata <- mapdata[!is.na("lat") & !is.na("lon")]
station.pal <- colorNumeric(c('purple', 'yellow'), domain= mapdata$datanum)
station.pal
stationmap <-leaflet(met2) |>
addProviderTiles('CartoDB.Positron') |>
addCircles(
lat = ~lat, lng = ~lon,
color = ~station.pal(mapdata$datanum),
opacity = 1, fillOpacity = 1, radius = 500
) |>
addLegend('bottomleft', pal=station.pal, values = mapdata$datanum,
title = 'Monitoring Stations', opacity = 1)
stationmap
```

Expand Down

0 comments on commit a06d80b

Please sign in to comment.