Request for Geochemistry

Setup


Attaching package: 'lubridate'
The following objects are masked from 'package:base':

    date, intersect, setdiff, union

Attaching package: 'zoo'
The following objects are masked from 'package:base':

    as.Date, as.Date.numeric
Loading required package: ggplot2
The legacy packages maptools, rgdal, and rgeos, underpinning the sp package,
which was just loaded, will retire in October 2023.
Please refer to R-spatial evolution reports for details, especially
https://r-spatial.org/r/2023/05/15/evolution4.html.
It may be desirable to make the sf package available;
package maintainers should consider adding sf to Suggests:.
The sp package is now running under evolution status 2
     (status 2 uses the sf package in place of rgdal)
ℹ Google's Terms of Service: <https://mapsplatform.google.com>
ℹ Please cite ggmap if you use it! Use `citation("ggmap")` for details.
── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
✔ dplyr   1.1.3     ✔ stringr 1.5.0
✔ forcats 1.0.0     ✔ tibble  3.2.1
✔ purrr   1.0.2     ✔ tidyr   1.3.0
✔ readr   2.1.4     
── 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

Site Location

Longitude= -122.086666
Latitude = 54.53

Geocode

Based on the site location, locations have been implemented and coordinates have been obtained using geocode from Google. Additionally, elevation information has been captured using Google Maps.

# Define the location you want to geocode
locations <- c("Bear Lake, BC, Canada",
               "McLeod Lake, BC, Canada",
               "Prince George, BC, Canada")

# Geocode the location
geocoded_location <- geocode(locations)

coord_tbl<-rbind(data.frame(site="site",
                            lon=Longitude, lat=Latitude),
                 data.frame(site=locations,
                            geocoded_location)) %>% 
        mutate(Elev=mapply(GM_elev,lon,lat,key_google=key_google))

pander::pandoc.table(coord_tbl)
site lon lat Elev
site -122.1 54.53 1209
Bear Lake, BC, Canada -122.7 54.49 716.5
McLeod Lake, BC, Canada -123 54.99 679.5
Prince George, BC, Canada -122.7 53.92 576.2

Location map

library(ggrepel)

xy <-ggmap::make_bbox(lon = coord_tbl$lon,
                      lat = coord_tbl$lat,f = 0.1)

map <- ggmap::get_map(xy,scale=2,zoom=8,maptype="hybrid",source="google",
               messaging=FALSE)

ggmap(map)+
        geom_point(data = coord_tbl,aes(x=lon,y=lat),col="red",size=5)+
        geom_label_repel(data=coord_tbl,aes(x=lon,y=lat,label=site),alpha=0.6)+
        labs(x="Longitude [deg]",y="Latitude [deg]")+
        ggsn::scalebar(x.min=-124,x.max=-121,y.min=53.7,y.max=55.2,dist = 25,
                       dist_unit = "km",transform = T,model = "WGS84")

Daymet

Based on SRK’s experience, the climatic gridded model Daymet is suitable for providing meteorological values related to precipitation and air temperature. However, it is recommended to perform bias correction of Daymet based on local records and location-specific information, such as Prince George, when available. This step was not implemented in this case but will be a part of the meteorological review for the project.

Daymet is a gridded meteorological dataset that provides daily estimates of minimum temperature, maximum temperature, precipitation, shortwave radiation, vapor pressure, and snow water equivalent over North America. The dataset is generated by merging ground-based observations with spatially interpolated weather data from multiple sources such as satellite and numerical weather models. The dataset is available for the period of 1980 to present, and it has a spatial resolution of 1km.

meteo_lst<-lapply(1:nrow(coord_tbl),FUN=function(x){
        
        pander::pandoc.header(coord_tbl[x,1],level=2)
        
        pander::pandoc.p('')
        
        pander::pandoc.p('')        
        
        daymet_info<-daymetr::download_daymet(site = coord_tbl[x,1],
                                              lat = coord_tbl[x,3],
                                              lon=coord_tbl[x,2])
        
        daymet_date<-ymd(paste0(daymet_info$data$year,"-01-01"))+
                days(daymet_info$data$yday-1) 
        
        daymet_info_tbl<-data.frame(date=daymet_date,daymet_info$data[,-c(1,2)])
        
        
        daymet_z<-tk_zoo(daymet_info_tbl) 
        
        daymet_ma_tbl<-rbind(
                daily2annual.avg(daymet_z$prcp..mm.day.),
                daily2annual.avg(daymet_z$tmax..deg.c.,FUN=mean),
                daily2annual.avg(daymet_z$tmin..deg.c.,FUN=mean),
                daily2annual.avg(0.5*daymet_z$tmax..deg.c. + 
                                         daymet_z$tmin..deg.c.,
                                 FUN = mean)) %>% 
                data.frame(parameter=c("Total Precip.","Max Air Temp.",
                                       "Min Air Temp.","Avg. Air Temp."),.)
        
        pander::pandoc.table(daymet_ma_tbl,round=1,split.table=Inf,
                             caption="Mean monthly values based on Daymet (1980 - 2022)")
        
        return(daymet_ma_tbl)
        
        
}) 

site

Mean monthly values based on Daymet (1980 - 2022)
parameter Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec Ann
Total Precip. 75.5 44.5 53.1 53.6 72.9 90.2 97.8 77.5 85.4 88.8 85.5 60 884.7
Max Air Temp. -5.2 -4.3 -0.1 5.6 12.6 16.6 19.2 18.6 13.2 5.7 -1.5 -5.9 6.3
Min Air Temp. -14.2 -15.2 -11.1 -5.1 0 4.2 6.5 5.1 1.4 -3.3 -9.4 -14.5 -4.6
Avg. Air Temp. -16.8 -17.3 -11.2 -2.4 6.2 12.5 16.1 14.4 8 -0.5 -10.1 -17.4 -1.5

Bear Lake, BC, Canada

Mean monthly values based on Daymet (1980 - 2022)
parameter Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec Ann
Total Precip. 55.6 32.4 36.2 34.6 51.9 68.5 71.7 55.5 62.1 67.2 61.1 44.1 641
Max Air Temp. -3.5 -1.8 3.5 10 16.6 20.3 22.6 21.9 16.4 8.7 1 -4 9.4
Min Air Temp. -11.7 -12.1 -7.8 -2.4 2.6 6.9 9 7.8 3.9 -0.8 -6.4 -11.8 -1.8
Avg. Air Temp. -13.5 -13 -6 2.6 10.9 17 20.3 18.8 12.1 3.6 -5.9 -13.8 2.8

McLeod Lake, BC, Canada

Mean monthly values based on Daymet (1980 - 2022)
parameter Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec Ann
Total Precip. 53.2 28.7 32 28.4 45.2 65.9 64.7 50.3 54.1 62.7 57.7 41.6 584.3
Max Air Temp. -4.2 -2.4 2.9 9.7 16.5 20.3 22.6 21.7 16.2 8.4 0.4 -4.6 9
Min Air Temp. -12.5 -12.7 -8.4 -2.6 2.6 7 9.2 7.9 4 -0.8 -6.9 -12.4 -2.1
Avg. Air Temp. -14.6 -13.9 -7 2.3 10.9 17.1 20.4 18.8 12.1 3.4 -6.7 -14.6 2.4

Prince George, BC, Canada

Mean monthly values based on Daymet (1980 - 2022)
parameter Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec Ann
Total Precip. 50.2 32 32.7 33.9 47.9 60.9 65.5 49.7 59.1 63.2 51.5 41.1 587.5
Max Air Temp. -2.2 -0.5 5.5 11.8 18.1 21.6 23.9 23.2 17.6 10 2.4 -2.8 10.8
Min Air Temp. -10.3 -10.5 -6 -1.4 3.5 7.5 9.6 8.6 4.7 0 -4.7 -10.2 -0.7
Avg. Air Temp. -11.4 -10.7 -3.2 4.5 12.5 18.3 21.5 20.2 13.5 5 -3.5 -11.6 4.7
names(meteo_lst)<-coord_tbl$site

Summary

meteo_tbl<-sapply(meteo_lst,FUN=function(x){x$Ann[c(1,4)]}) %>% t() %>% 
        data.frame()

coord_complete_tbl<-cbind(coord_tbl,map=meteo_tbl$X1,maat=meteo_tbl$X2)

pander::pandoc.table(coord_complete_tbl)
site lon lat Elev map maat
site -122.1 54.53 1209 884.7 -1.458
Bear Lake, BC, Canada -122.7 54.49 716.5 641 2.838
McLeod Lake, BC, Canada -123 54.99 679.5 584.3 2.43
Prince George, BC, Canada -122.7 53.92 576.2 587.5 4.664
ggmap(map)+
        geom_point(data = coord_tbl,aes(x=lon,y=lat),col="red",size=5)+
        geom_label_repel(data=coord_complete_tbl,
                         aes(x=lon,y=lat,
                             label=glue::glue("{site}
                                              MAP = {round(map,0)} mm/yr
                                              MAAT = {round(maat,1)} degC")),
                         alpha=0.8,size=2.5)+
        labs(x="Longitude [deg]",y="Latitude [deg]",
             title="Meteorological information",
             subtitle="Values based on Daymet from 1980 to 2022")+
        ggsn::scalebar(x.min=-124,x.max=-121,y.min=53.7,y.max=55.2,dist = 25,
                       dist_unit = "km",transform = T,model = "WGS84")