Skip to content

Commit f21ab91

Browse files
committed
Update mwlSource
1 parent 514257e commit f21ab91

File tree

5 files changed

+51
-45
lines changed

5 files changed

+51
-45
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: isoWater
22
Type: Package
33
Title: Discovery, Retrieval, and Analysis of Water Isotope Data
4-
Version: 0.2.1
4+
Version: 0.2.2
55
Authors@R: person("Gabriel", "Bowen", email = "gabe.bowen@utah.edu",
66
role = c("aut", "cre"))
77
Description: wiDB_ functions provide interface to the public API of

NEWS.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
# isoWater news
22

3+
## isoWater 0.2.2
4+
* Changed default stype option for mwlSource to protect from misuse
5+
* Bug fixes
6+
37
## isoWater 0.2.1
48
* Merged functions and documentation from wiDButil package
59
* Updated documentation and vignette
610

7-
811
## isoWater 0.2.0
912
* Reformatted code to create package
1013
* Added function mwl to calculate stats for a MWL based on H and O data

R/watercomp.R

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,12 @@
77
mwlSource = function(obs, MWL=c(8.01, 9.57, -8.096, 2564532.2, 5.76, 80672),
88
slope, stype = 1, ngens=1e4, ncores = 1){
99

10+
if(MWL[6] == 80672 & stype == 2){
11+
warning("Using stype=2 and GMWL is inappropriate for most applications; see man")
12+
}
13+
1014
if(class(obs)[2] != "iso"){
11-
warning("Expecting iso object for obs, this argument may be
12-
formatted incorrectly")
15+
warning("Expecting iso object for obs, this argument may be formatted incorrectly")
1316
}
1417
if(!(stype %in% c(1, 2))){
1518
stop("stype must be 1 or 2, see ?mwlSource")
@@ -32,13 +35,13 @@ mwlSource = function(obs, MWL=c(8.01, 9.57, -8.096, 2564532.2, 5.76, 80672),
3235
o_cent = (MWL[2] - (obs$H - slope[1] * obs$O) ) / (slope[1]-MWL[1])
3336

3437
#large range of d18O values to evaluate
35-
o_eval = seq(o_cent - 25, o_cent + 25, by = 0.1)
38+
o_eval = seq(o_cent - 25, o_cent + 25, by = 0.001)
3639

3740
#sample or mean stats?
3841
if(stype == 1){
39-
MWL = c(MWL, 1 / MWL[6])
40-
} else{
4142
MWL = c(MWL, 1 + 1 / MWL[6])
43+
} else{
44+
MWL = c(MWL, 1 / MWL[6])
4245
}
4346

4447
#CI or PI bounds on MWL d2H

0 commit comments

Comments
 (0)