IMMM-SFA / gamut

An R package to identify multi-sector teleconnection complexity
https://immm-sfa.github.io/gamut/
Other
0 stars 3 forks source link

Rochester | NY and Syracuse | NY not working with splice function. #61

Closed KristianNelson closed 4 years ago

crvernon commented 4 years ago

@KristianNelson @swd-turner Can you post the error message you are getting?

KristianNelson commented 4 years ago

@crvernon

Error in uniroot(function(x) target_function(fraction, x, coords, ply, : f() values at end points not of opposite sign In addition: Warning messages: 1: In if (is.na(f.lower)) stop("f.lower = f(lower) is NA") : the condition has length > 1 and only the first element will be used 2: In if (is.na(f.upper)) stop("f.upper = f(upper) is NA") : the condition has length > 1 and only the first element will be used Called from: uniroot(function(x) target_function(fraction, x, coords, ply, total_area), lower = coords$xmin_source, upper = coords$xmax_source)

This is the same error we were getting earlier on, and we fixed it by changing cbind to rbind, and I can't figure out why it is happening again.

crvernon commented 4 years ago

@KristianNelson do you think it may be due to trying to evaluate multiple polygons? Does Rochester and/or Syracuse have multiple watersheds? Our initial tests were on single polygon watersheds.

KristianNelson commented 4 years ago

@crvernon They are single watershed cities, which is why it's so odd.

KristianNelson commented 4 years ago

This was resolved when we stopped using the splice function and instead did analysis on single watersheds.