SPATIAL-Lab / assignR

R package for geographic assignment
17 stars 4 forks source link

default value for the valiStation in QA function #15

Closed Demerara closed 4 years ago

Demerara commented 4 years ago

@bumbanian

QA(isoscape, known, valiStation = floor(length(known)*0.1), valiTime = 50, 
  mask = NULL, setSeed = TRUE, name = NULL)

If the length of known is less than 10, then the default value of valiStation would be floor(length(known)*0.1 = 0, which will cause an error. How about replacing valiStation = floor(length(known)*0.1) with just valiStation = 1?

bumbanian commented 4 years ago

I think it’s preferable to have a larger number. But the point is a good one. I think 1) changing the default to use ceiling instead of floor, 2) issue a warning if length(known) < 10, and 3) in error checking include

if(length(known) < 3) {stop(“QA requires at least 3 known samples”)}

Sent from my iPhone

On Apr 4, 2020, at 2:22 PM, Chao Ma notifications@github.com wrote:



@bumbanianhttps://github.com/bumbanian

QA(isoscape, known, valiStation = floor(length(known)*0.1), valiTime = 50, mask = NULL, setSeed = TRUE, name = NULL)

If the length of known is less than 10, then the default value of valiStation would be floor(length(known)0.1 = 0, which will cause an error. How about replacing valiStation = floor(length(known)0.1) with just valiStation = 1?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/SPATIAL-Lab/assignR/issues/15, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ACGLIN77TKDGXSUPJ54IKG3RK6JJTANCNFSM4L7CBRSA.

Demerara commented 4 years ago

Done. Please see commit: https://github.com/SPATIAL-Lab/assignR/commit/79146b21e9e5f977d8ddab23bba1f84504844c48