Hi there,
I am hoping to get some advice/guidance on how to make a map as an R newbie.
I want to make a map showing a temperature gradient across a river. I have the longitudes, latitudes, temperature and other environmental variables such as salinity. I am envisioning something like this:
This is what my data looks like:
> dput(water)
structure(list(ID = c(482914L, 482555L, 482536L, 482928L, 482592L,
482563L, 482520L, 482530L, 482942L, 482508L, 482573L, 482570L,
482524L, 482505L, 482599L, 482544L, 482539L, 482533L, 482514L,
482516L, 482933L, 482951L, 482909L, 482904L, 482578L, 482511L,
482502L, 482549L, 482583L), Lat = c(49.1655, 48.2795, 48.057667,
49.764, 48.954, 48.558667, 47.742333, 47.696, 49.616, 47.094667,
48.575667, 48.473667, 47.696, 46.887167, 49.0365, 48.348333,
48.072833, 48.027667, 47.403833, 47.3935, 49.749167, 49.412833,
49.040333, 48.830667, 48.787833, 47.415667, 49.0365, 48.317333,
48.666833), Long = c(-67.2685, -69.072167, -69.548833, -66.8895,
-68.0945, -68.845333, -69.927833, -69.821667, -66.661167, -70.716167,
-68.489833, -68.6655, -69.821667, -70.9235, -68.267667, -69.327667,
-69.6245, -69.485667, -70.283833, -70.229833, -65.500333, -66.481,
-67.104167, -67.857, -68.711167, -70.440833, -68.267667, -69.199667,
-68.581167), Temp = c(10.48, 5, 6.77, 9.48, 10.72, 6.04, 8.33,
10.05, 11.37, 19.26, 6.92, 6.4, 10, 23.7, 4.87, 5.95, 2.88, 5.49,
17.55, 15.27, 9.54, 10.74, 6.32, 8.97, 9.84, 13.45, 23.4, 5.2,
11.12), Salinity = c(29.16, 28.87, 26.78, 29.53, 24.77, 29.11,
24.14, 22.81, 28.99, 6.82, 28.63, 28.78, 23.13, 0.12, 29.9, 29.42,
30.77, 28.37, 9.96, 13.57, 29.97, 29.18, 28.99, 27.65, 27.2,
16.31, 0.12, 29.41, 27.54)), class = "data.frame", row.names = c(NA,
-29L))
I am not sure how to go about starting and which packages to use... I have gotten as far as to crop the area I am interested in using ggmap
library(ggmap)
qc <- c(left = -74, bottom = 45, right = -58, top = 52)
map <- get_stamenmap(qc, zoom = 7, maptype = "toner-lite")
ggmap(map)
Any help is appreciated, thank you.