The following object is masked from 'package:zoo':
time<-
The following object is masked from 'package:tidyr':
extract
daily raster for MERRA2 : merra2_ras
mean annual raster for MERRA2 : merra2_ma_ras
mean annual TABLE for MERRA2 : merra2_ma_tbl
gauge_ps_z<-pbapply::pblapply(1:nrow(gauge_loc),FUN=function(x){ ps_z<-nc2z_fn(Longitude = gauge_loc[x,3] %>%pull(),Latitude = gauge_loc[x,2] %>%pull(),source ="MERRA2") %>% udunits2::ud.convert(.,"Pa","kPa")*0.102#conversion from Kpa to meters of head}) %>%do.call(merge,.)names(gauge_ps_z)<-gauge_loc$Gaugeplot(gauge_ps_z,main="Hourly records for PS from MERRA2[m Head]")
daily raster for MERRA2 : merra2_ras
mean annual raster for MERRA2 : merra2_ma_ras
mean annual TABLE for MERRA2 : merra2_ma_tbl
gauge_t2m_z<-pbapply::pblapply(1:nrow(gauge_loc),FUN=function(x){ ps_z<-nc2z_fn(Longitude = gauge_loc[x,3] %>%pull(),Latitude = gauge_loc[x,2] %>%pull(),source ="MERRA2") %>% udunits2::ud.convert(.,"K","degC")}) %>%do.call(merge,.)names(gauge_t2m_z)<-gauge_loc$Gaugeplot(gauge_t2m_z,main="Hourly records for Air Temperature from MERRA2[degC]")
Comparison of results
library(readr)library(hydroTSM)
Loading required package: xts
######################### Warning from 'xts' package ##########################
# #
# The dplyr lag() function breaks how base R's lag() function is supposed to #
# work, which breaks lag(my_xts). Calls to lag(my_xts) that you type or #
# source() into this session won't work correctly. #
# #
# Use stats::lag() to make sure you're not using dplyr::lag(), or you can add #
# conflictRules('dplyr', exclude = 'lag') to your .Rprofile to stop #
# dplyr from breaking base R's lag() function. #
# #
# Code in packages is not affected. It's protected by R's namespace mechanism #
# Set `options(xts.warn_dplyr_breaks_lag = FALSE)` to suppress this warning. #
# #
###############################################################################
Attaching package: 'xts'
The following objects are masked from 'package:dplyr':
first, last
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)
Please note that 'maptools' will be retired during October 2023,
plan transition at your earliest convenience (see
https://r-spatial.org/r/2023/05/15/evolution4.html and earlier blogs
for guidance);some functionality will be moved to 'sp'.
Checking rgeos availability: FALSE
Attaching package: 'hydroTSM'
The following object is masked from 'package:terra':
extract
The following object is masked from 'package:tidyr':
extract
baro_tbl <-read_csv(here::here("data","csv","1037A_Baro.csv"), col_types =cols(Date =col_date(format ="%Y-%m-%d"), Time =col_time(format ="%H:%M:%S")), skip =10)baro_ps_z<-zoo(baro_tbl$LEVEL,ymd_hms(paste0(baro_tbl$Date," ",baro_tbl$Time)))plot(baro_ps_z,main="Barometric Pressure measured at Barologger")
baro_t2m_z<-zoo(baro_tbl$TEMPERATURE,ymd_hms(paste0(baro_tbl$Date," ",baro_tbl$Time)))plot(baro_t2m_z,main="Air Temperature measured at Barologger")
PS
merge(baro_ps_z-4.25,"MERRA2@G01"=gauge_ps_z$G01) %>%na.approx() %>% dygraphs::dygraph(ylab ="m of Head")