Skip to content

Commit 953ebae

Browse files
committed
Update bugFixes
Merge branch 'master' of https://github.com/SPATIAL-Lab/isoWater # Conflicts: # DESCRIPTION # NEWS.md
2 parents eb02c05 + e933832 commit 953ebae

File tree

5 files changed

+15
-4
lines changed

5 files changed

+15
-4
lines changed

DESCRIPTION

Lines changed: 1 addition & 2 deletions
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: 1.1.0
4+
Version: 1.1.0.9000
55
Authors@R: person("Gabe", "Bowen", email = "gabe.bowen@utah.edu",
66
role = c("aut", "cre"))
77
Maintainer: Gabe Bowen <gabe.bowen@utah.edu>
@@ -26,4 +26,3 @@ License: GPL-3
2626
Language: en-US
2727
Encoding: UTF-8
2828
LazyData: true
29-
RoxygenNote: 7.1.2

NEWS.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# isoWater news
22

3+
## isoWater 1.1.0.9000
4+
* iso function now checks for and removes data with missing values
5+
* Bug fixes
6+
37
## isoWater 1.1.0
48
* Add dex function
59
* Bug and spelling fixes

R/constructors.R

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ iso = function(H, O, Hsd, Osd, HOc = 0){
88
if(any(v$HOc > v$Hsd * v$Osd)){
99
stop("Inconsistent SD and COV values")
1010
}
11+
if(any(rowSums(is.na(v)) > 0)){
12+
v = v[rowSums((is.na(v))) == 0,]
13+
warning("One or more samples include misisng values and were dropped")
14+
}
1115
class(v)[2] = "iso"
1216
return(v)
1317
}

R/watercomp.R

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ mwlSource = function(obs, MWL = NULL, slope, stype = 1, ngens=1e4, ncores = 1){
1515
if(MWL[6] == 80672 & stype == 2){
1616
warning("Using stype=2 and GMWL is inappropriate for most applications; see man")
1717
}
18-
1918
if(!inherits(obs, "iso")){
2019
warning("Expecting iso object for obs, this argument may be formatted incorrectly")
2120
}
@@ -37,7 +36,7 @@ mwlSource = function(obs, MWL = NULL, slope, stype = 1, ngens=1e4, ncores = 1){
3736

3837
#establish credible range for source water d18O
3938
#center calculated as intersection of EL and MWL
40-
o_cent = (MWL[2] - (obs$H - slope[1] * obs$O) ) / (slope[1]-MWL[1])
39+
o_cent = (MWL[2] - (mean(obs$H) - slope[1] * mean(obs$O)) ) / (slope[1]-MWL[1])
4140

4241
#large range of d18O values to evaluate
4342
o_eval = seq(o_cent - 25, o_cent + 25, by = 0.001)

R/wiDBfunctions.R

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,11 @@ wiDB_data = function(minLat = NULL, maxLat = NULL, minLong = NULL, maxLong = NUL
193193
return(NULL)
194194
}
195195

196+
if(g$headers$`content-length` == 0){
197+
message("Content-length zero")
198+
return(NULL)
199+
}
200+
196201
fn = g$headers$`content-disposition`
197202
fn = strsplit(fn, "=")[[1]][2]
198203
writeBin(g$content, paste0(tmpdir, "/", fn))

0 commit comments

Comments
 (0)