-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
129 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,3 +11,4 @@ | |
^data-raw/dbasing_0407\.sas7bdat$ | ||
^data-raw/*$ | ||
^R/helpers\.R$ | ||
^data-raw$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
util_ad_prepverna <- function(fl, fillmis = T){ | ||
|
||
dat <- read.csv(fl, header = T, stringsAsFactors = F) |> | ||
dplyr::mutate(Month = seas + 0) |> | ||
dplyr::select( | ||
Year = yr, | ||
Month = mo, | ||
nh4 = NH4, | ||
no3 = NO3 | ||
) | ||
|
||
# fill missing annual data by monthly means from other years | ||
if(fillmis) | ||
dat <- dat #|> | ||
# dplyr::mutate( | ||
# nh4 | ||
# ) | ||
|
||
dat <- dat |> | ||
mutate( | ||
nh4 = nh4 * 0.78, # NADP data are reported as mg NO3 and mg NH4, this corrects for % of ions that is N; | ||
no3 = no3 * 0.23, | ||
TNConc = nh4 + no3, | ||
TPConc = 0.01262 * TNConc + 0.00110 # from regression relationship between TBADS TN and TP, applied to Verna; | ||
) %>% | ||
select(yr, mo, TNConc, TPConc) | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Verna well field NADP NTN atmospheric deposition concentration data | ||
# https://nadp.slh.wisc.edu/sites/ntn-FL41/ | ||
# 2017 to 2022 | ||
|
||
library(here) | ||
library(dplyr) | ||
|
||
verna <- read.csv(file = here("data-raw/NTN-fl41-i-mgl_2017-2022.csv")) %>% | ||
mutate(mo = seas + 0) %>% | ||
mutate( | ||
nh4 = case_when( | ||
yr == 2022 & mo == 12 ~ mean(c(0.046, 0.063, 0.09, 0.105, 0.173)), # Dec. NH4 mean from 2017-2021 to fill in missing data | ||
TRUE ~ NH4 | ||
), | ||
no3 = case_when( | ||
yr == 2022 & mo == 12 ~ mean(c(0.194, 0.257, 0.364, 0.327, 1.41)), # Dec. NO3 mean from 2017-2021 to fill in missing data | ||
TRUE ~ NO3 | ||
), | ||
nh4 = nh4 * 0.78, # NADP data are reported as mg NO3 and mg NH4, this corrects for % of ions that is N; | ||
no3 = no3 * 0.23, | ||
TNConc = nh4 + no3, | ||
TPConc = 0.01262 * TNConc + 0.00110 # from regression relationship between TBADS TN and TP, applied to Verna; | ||
) %>% | ||
select(yr, mo, TNConc, TPConc) | ||
|
||
usethis::use_data(verna, overwrite = TRUE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
siteID,seas,yr,Criteria1,Criteria2,Criteria3,Ca,Mg,K,Na,NH4,NO3,Cl,SO4,pH,conduc,svol,ppt,fullChemLab,daysSample,startDate,endDate | ||
FL41,1,2017,50,100,13,.086,.016,.019,.085,.195,.437,.214,.986,4.680,12.700,397.100,4.437,1,28,"Jan 3 2017 12:00AM","Jan 31 2017 12:00AM" | ||
FL41,10,2017,25,100,40,.027,.031,.013,.254,.035,.092,.500,.183,5.330,4.200,1535.700,8.407,1,28,"Oct 3 2017 12:00AM","Oct 31 2017 12:00AM" | ||
FL41,11,2017,50,100,38,.074,.034,.018,.235,.165,.627,.432,.400,5.150,6.700,755.300,3.861,1,28,"Oct 31 2017 12:00AM","Nov 28 2017 12:00AM" | ||
FL41,12,2017,100,100,100,.039,.051,.022,.389,.046,.194,.746,.243,5.200,6.300,1941.400,3.708,1,35,"Nov 28 2017 12:00AM","Jan 2 2018 12:00AM" | ||
FL41,2,2017,100,100,100,.082,.038,.023,.272,.133,.479,.501,.799,4.841,9.846,3279.600,4.829,3,28,"Jan 31 2017 12:00AM","Feb 28 2017 12:00AM" | ||
FL41,3,2017,100,100,100,.073,.032,.022,.227,.119,.334,.446,.474,4.970,7.693,2673.900,4.000,2,35,"Feb 28 2017 12:00AM","Apr 4 2017 12:00AM" | ||
FL41,4,2017,50,100,12,-9.000,-9.000,-9.000,-9.000,-9.000,-9.000,-9.000,-9.000,-9.000,-9.000,14.400,.203,0,28,"Apr 4 2017 12:00AM","May 2 2017 12:00AM" | ||
FL41,5,2017,75,100,93,.366,.122,.063,.794,.442,1.030,1.439,.670,5.665,12.197,4706.500,7.468,3,28,"May 2 2017 12:00AM","May 30 2017 12:00AM" | ||
FL41,6,2017,100,100,100,.061,.044,.022,.344,.110,.452,.629,.386,5.054,6.900,25297.800,36.805,4,28,"May 30 2017 12:00AM","Jun 27 2017 12:00AM" | ||
FL41,7,2017,100,100,100,.082,.041,.018,.299,.094,.661,.559,.372,5.033,7.441,19408.100,29.007,5,35,"Jun 27 2017 12:00AM","Aug 1 2017 12:00AM" | ||
FL41,8,2017,100,100,100,.062,.032,.014,.254,.038,.410,.469,.246,5.115,5.914,23593.600,41.986,4,28,"Aug 1 2017 12:00AM","Aug 29 2017 12:00AM" | ||
FL41,9,2017,80,100,95,.111,.090,.034,.671,.029,.262,1.286,.385,5.212,8.343,14220.600,24.003,3,35,"Aug 29 2017 12:00AM","Oct 3 2017 12:00AM" | ||
FL41,1,2018,75,100,99,.099,.074,.027,.595,.132,.289,1.067,.361,5.400,7.900,3955.100,6.299,1,28,"Jan 2 2018 12:00AM","Jan 30 2018 12:00AM" | ||
FL41,10,2018,50,100,56,.093,.124,.045,1.029,.047,.380,1.779,.728,4.990,12.300,1271.200,5.176,1,28,"Oct 2 2018 12:00AM","Oct 30 2018 12:00AM" | ||
FL41,11,2018,100,100,100,.242,.056,.032,.340,.116,.648,.635,.662,5.106,8.209,5444.400,9.804,4,35,"Oct 30 2018 12:00AM","Dec 4 2018 12:00AM" | ||
FL41,12,2018,100,100,100,.109,.156,.054,1.219,.063,.257,2.300,.664,5.160,12.930,10053.000,16.002,4,28,"Dec 4 2018 12:00AM","Jan 1 2019 12:00AM" | ||
FL41,2,2018,75,100,92,.029,.039,.016,.323,.057,.223,.551,.369,5.100,6.300,1212.000,1.956,1,28,"Jan 30 2018 12:00AM","Feb 27 2018 12:00AM" | ||
FL41,3,2018,20,100,35,.333,.111,.050,.774,.701,1.946,1.163,1.444,5.180,16.100,672.900,2.876,1,35,"Feb 27 2018 12:00AM","Apr 3 2018 12:00AM" | ||
FL41,4,2018,50,100,93,.112,.046,.031,.341,.191,.549,.627,.846,4.999,9.117,4456.700,7.029,2,28,"Apr 3 2018 12:00AM","May 1 2018 12:00AM" | ||
FL41,5,2018,100,100,100,.032,.021,.015,.173,.097,.363,.313,.274,5.165,4.938,23946.300,37.109,4,28,"May 1 2018 12:00AM","May 29 2018 12:00AM" | ||
FL41,6,2018,80,100,77,.178,.047,.023,.297,.124,.922,.513,.546,5.005,8.236,6767.700,12.979,4,35,"May 29 2018 12:00AM","Jul 3 2018 12:00AM" | ||
FL41,7,2018,100,100,100,.104,.030,.016,.220,.109,.703,.393,.432,4.993,7.224,17928.100,27.178,4,28,"Jul 3 2018 12:00AM","Jul 31 2018 12:00AM" | ||
FL41,8,2018,100,100,100,.119,.044,.020,.295,.077,.789,.529,.427,4.943,7.859,12146.100,19.075,4,28,"Jul 31 2018 12:00AM","Aug 28 2018 12:00AM" | ||
FL41,9,2018,100,100,100,.075,.016,.008,.103,.066,.515,.180,.277,5.115,4.921,24994.000,38.463,5,35,"Aug 28 2018 12:00AM","Oct 2 2018 12:00AM" | ||
FL41,1,2019,44,88,81,.052,.036,.018,.285,.076,.234,.533,.391,4.939,6.059,5002.500,9.804,2,32,"Jan 1 2019 12:00AM","Jan 29 2019 12:00AM" | ||
FL41,10,2019,44,88,72,.064,.026,.012,.208,.103,.329,.370,.398,5.205,5.043,10435.800,21.514,2,32,"Oct 1 2019 12:00AM","Oct 29 2019 12:00AM" | ||
FL41,11,2019,80,100,91,.137,.079,.026,.512,.092,.389,.956,.597,5.085,8.539,1614.100,2.870,3,35,"Oct 29 2019 12:00AM","Dec 3 2019 12:00AM" | ||
FL41,12,2019,50,100,28,.052,.066,.032,.551,.090,.364,.985,.319,5.250,7.100,1169.700,6.071,1,28,"Dec 3 2019 12:00AM","Dec 31 2019 12:00AM" | ||
FL41,2,2019,66,88,53,.091,.086,.038,.689,.086,.416,1.231,.760,4.837,11.590,1003.500,3.188,3,32,"Jan 29 2019 12:00AM","Feb 26 2019 12:00AM" | ||
FL41,3,2019,90,100,99,.132,.055,.047,.383,.159,.552,.722,.566,5.266,7.742,3877.600,6.909,2,31,"Feb 26 2019 12:00AM","Apr 2 2019 12:00AM" | ||
FL41,4,2019,75,100,99,.085,.064,.038,.513,.129,.401,.923,.642,5.062,9.066,3799.400,5.905,3,28,"Apr 2 2019 12:00AM","Apr 30 2019 12:00AM" | ||
FL41,5,2019,100,100,100,.179,.045,.037,.281,.227,.660,.535,.495,5.555,6.123,6873.000,10.947,3,34,"Apr 30 2019 12:00AM","Jun 4 2019 12:00AM" | ||
FL41,6,2019,100,100,100,.081,.029,.015,.198,.073,.515,.382,.340,5.143,5.828,18047.900,26.772,4,24,"Jun 4 2019 12:00AM","Jul 2 2019 12:00AM" | ||
FL41,7,2019,93,93,100,.098,.033,.016,.233,.074,.714,.418,.407,4.964,7.457,18518.000,26.924,4,30,"Jul 2 2019 12:00AM","Jul 30 2019 12:00AM" | ||
FL41,8,2019,100,100,100,.077,.031,.034,.235,.081,.653,.434,.344,5.033,6.793,12379.800,19.634,5,35,"Jul 30 2019 12:00AM","Sep 3 2019 12:00AM" | ||
FL41,9,2019,54,100,86,.189,.112,.141,.812,.055,.468,1.534,.752,5.140,10.800,1279.800,3.277,1,26,"Sep 3 2019 12:00AM","Oct 1 2019 12:00AM" | ||
FL41,1,2020,82,100,98,.116,.036,.024,.249,.164,.461,.454,.750,4.938,8.837,1728.200,2.794,3,34,"Dec 31 2019 12:00AM","Feb 4 2020 12:00AM" | ||
FL41,10,2020,100,100,100,.104,.075,.034,.573,.130,.411,1.053,.495,5.368,7.924,6373.000,9.449,5,35,"Sep 29 2020 12:00AM","Nov 3 2020 12:00AM" | ||
FL41,11,2020,81,100,95,.059,.118,.050,.995,.040,.158,1.839,.502,5.215,10.355,8401.600,13.005,3,26,"Nov 3 2020 12:00AM","Dec 1 2020 12:00AM" | ||
FL41,12,2020,88,88,100,.080,.043,.018,.326,.105,.327,.611,.654,4.988,8.413,2996.600,4.369,4,32,"Dec 1 2020 12:00AM","Dec 29 2020 12:00AM" | ||
FL41,2,2020,100,100,100,.099,.073,.039,.569,.094,.350,1.023,.588,5.237,8.516,3372.000,4.951,4,28,"Feb 4 2020 12:00AM","Mar 3 2020 12:00AM" | ||
FL41,3,2020,0,100,0,-9.000,-9.000,-9.000,-9.000,-9.000,-9.000,-9.000,-9.000,-9.000,-9.000,.000,2.184,0,28,"Mar 3 2020 12:00AM","Mar 31 2020 12:00AM" | ||
FL41,4,2020,66,88,97,.092,.052,.059,.405,.476,.679,.723,.809,5.456,8.856,11067.000,19.329,3,32,"Mar 31 2020 12:00AM","Apr 28 2020 12:00AM" | ||
FL41,5,2020,100,100,100,.132,.046,.031,.321,.274,.767,.573,.510,5.369,7.305,10131.100,16.713,5,31,"Apr 28 2020 12:00AM","Jun 2 2020 12:00AM" | ||
FL41,6,2020,75,100,98,.110,.042,.018,.287,.129,.490,.507,.413,5.440,6.031,18535.700,29.743,3,28,"Jun 2 2020 12:00AM","Jun 30 2020 12:00AM" | ||
FL41,7,2020,100,100,100,.189,.054,.023,.334,.103,.765,.615,.518,5.137,7.977,9012.400,15.164,5,34,"Jun 30 2020 12:00AM","Aug 4 2020 12:00AM" | ||
FL41,8,2020,100,100,100,.110,.037,.015,.246,.070,.660,.451,.447,4.950,7.803,13078.000,19.050,4,26,"Aug 4 2020 12:00AM","Sep 1 2020 12:00AM" | ||
FL41,9,2020,93,93,100,.103,.023,.011,.122,.058,.341,.205,.261,5.361,4.245,16380.600,25.222,4,30,"Sep 1 2020 12:00AM","Sep 29 2020 12:00AM" | ||
FL41,1,2021,60,100,60,.117,.131,.051,1.042,.101,.537,1.909,.894,4.905,14.733,795.900,2.286,2,35,"Dec 29 2020 12:20PM","Feb 2 2021 10:00AM" | ||
FL41,10,2021,58,100,18,.285,.079,.030,.518,.095,.647,.961,.831,5.180,9.000,930.300,7.518,1,34,"Sep 29 2021 9:00AM","Nov 2 2021 9:00AM" | ||
FL41,11,2021,100,100,100,.076,.052,.020,.410,.058,.467,.708,.469,4.971,8.512,3337.200,5.131,3,28,"Nov 2 2021 9:00AM","Nov 30 2021 9:55AM" | ||
FL41,12,2021,74,100,5,.757,.126,.107,.728,.173,1.410,1.482,.978,5.210,16.300,72.900,2.464,1,28,"Nov 30 2021 9:55AM","Dec 28 2021 11:50AM" | ||
FL41,2,2021,100,100,100,.095,.102,.048,.828,.099,.349,1.567,.691,5.126,10.501,3551.600,5.664,3,28,"Feb 2 2021 10:00AM","Mar 2 2021 10:00AM" | ||
FL41,3,2021,100,100,100,.233,.066,.042,.482,.275,.842,.849,.771,5.230,9.911,6770.100,9.982,3,28,"Mar 2 2021 10:00AM","Mar 30 2021 9:00AM" | ||
FL41,4,2021,100,100,100,.232,.080,.050,.676,.279,.683,1.220,.987,5.185,11.210,7856.400,11.836,4,35,"Mar 30 2021 9:00AM","May 4 2021 9:00AM" | ||
FL41,5,2021,100,100,93,.218,.065,.047,.588,.372,1.234,1.080,.727,5.220,10.900,300.400,.475,1,28,"May 4 2021 9:00AM","Jun 1 2021 8:55AM" | ||
FL41,6,2021,100,100,100,.092,.037,.017,.299,.117,.513,.516,.307,5.324,5.626,15524.400,22.798,4,27,"Jun 1 2021 8:55AM","Jun 28 2021 9:20PM" | ||
FL41,7,2021,100,100,100,.045,.024,.027,.184,.051,.296,.328,.200,5.339,4.193,18926.300,28.575,4,36,"Jun 28 2021 9:20PM","Aug 3 2021 9:00AM" | ||
FL41,8,2021,66,100,73,.074,.037,.017,.239,.050,.505,.413,.318,5.076,6.390,14807.500,30.232,3,28,"Aug 3 2021 9:00AM","Aug 31 2021 9:00AM" | ||
FL41,9,2021,100,100,100,.138,.036,.020,.220,.073,.462,.379,.345,5.294,5.267,10096.900,15.113,4,29,"Aug 31 2021 9:00AM","Sep 29 2021 9:00AM" | ||
FL41,1,2022,60,100,95,.264,.371,.128,3.128,.216,.737,5.567,2.083,4.661,34.221,2026.200,3.378,2,35,"Dec 28 2021 11:50AM","Feb 1 2022 9:55AM" | ||
FL41,10,2022,75,100,57,.183,.050,.024,.317,.146,.738,.540,.664,5.110,8.300,1069.500,2.794,1,28,"Oct 4 2022 12:45PM","Nov 1 2022 9:00AM" | ||
FL41,11,2022,74,100,98,.054,.067,.025,.552,.031,.167,1.024,.285,5.237,7.002,6304.000,9.677,3,28,"Nov 1 2022 9:00AM","Nov 29 2022 10:00AM" | ||
FL41,12,2022,39,99,0,-9.000,-9.000,-9.000,-9.000,-9.000,-9.000,-9.000,-9.000,-9.000,-9.000,3.700,6.807,0,35,"Nov 29 2022 10:00AM","Jan 3 2023 11:50AM" | ||
FL41,2,2022,100,100,97,.087,.025,.020,.192,.145,.516,.353,.707,4.960,7.200,1254.700,2.007,1,28,"Feb 1 2022 9:55AM","Mar 1 2022 9:55AM" | ||
FL41,3,2022,100,100,100,.261,.108,.054,.751,.121,.451,1.372,.604,5.384,10.054,2400.000,3.708,4,28,"Mar 1 2022 9:55AM","Mar 29 2022 9:00AM" | ||
FL41,4,2022,79,100,99,.330,.081,.042,.462,.331,.891,.826,.702,5.618,9.217,9985.100,15.621,4,35,"Mar 29 2022 9:00AM","May 3 2022 9:00AM" | ||
FL41,5,2022,75,100,81,.107,.049,.028,.361,.156,.460,.635,.442,5.394,6.417,3581.900,6.528,2,28,"May 3 2022 9:00AM","May 31 2022 9:00AM" | ||
FL41,6,2022,100,100,100,.206,.043,.025,.264,.209,.951,.445,.494,5.336,7.443,13724.200,20.447,4,28,"May 31 2022 9:00AM","Jun 28 2022 11:00AM" | ||
FL41,7,2022,100,100,100,.147,.037,.020,.233,.103,.697,.410,.342,5.144,6.617,8187.400,11.887,5,35,"Jun 28 2022 11:00AM","Aug 2 2022 10:30AM" | ||
FL41,8,2022,100,100,100,.128,.027,.022,.157,.067,.637,.275,.301,5.096,5.978,12617.200,18.644,4,28,"Aug 2 2022 10:30AM","Aug 30 2022 9:05AM" | ||
FL41,9,2022,100,100,100,.140,.044,.032,.078,.028,.234,.139,.164,5.347,3.955,31308.000,51.562,5,35,"Aug 30 2022 9:05AM","Oct 4 2022 12:45PM" |