You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
NAs cause problems with mrClosed(). Need to make a catch and send the user a warning.
Here is the issue. In a Schnabel method the first sample will have no marked fish (and thus m[1]=0) and it is irrelevant how many marked fish are returned to the population after the last sample (thus, either R[length(R)]=0 or R[length(R)]=n[length(n)]. However, some users may enter NA values for these positions, which will cause an error as shown below.
> WAL <- mrClosed(n =c(321,412,178,415,367),
+ m = c(NA,45,55,93,113),
+ R = c(321,412,178,415,NA),
+ method ="Schnabel")
> cbind(summary(WAL),confint(WAL,verbose=TRUE))
Error in if (object$sum.m < 50) type <- "Poisson" else type <- "normal" :
missing value where TRUE/FALSE needed
A better result would be to catch these and replace them with zeroes with a warning sent to the user.
The text was updated successfully, but these errors were encountered:
This has been addressed in the latest development version of FSA.
The version with NAs ...
> WAL <- mrClosed(n =c(321,412,178,415,367),
+ m = c(NA,45,55,93,113),
+ R = c(321,412,178,415,NA),
+ method ="Schnabel")
Warning messages:
1: NA for last sample of 'R' was ignored.
2: NA for first sample of 'm' was ignored.
> cbind(summary(WAL),confint(WAL,verbose=TRUE))
The normal distribution was used.
N 95% LCI 95% UCI
[1,] 3280 2832 3898
... gives the same results but with warnings as the version without NAs ...
> WAL <- mrClosed(n =c(321,412,178,415,367),
+ m = c(0,45,55,93,113),
+ R = c(321,412,178,415,367),
+ method ="Schnabel")
> cbind(summary(WAL),confint(WAL,verbose=TRUE))
The normal distribution was used.
N 95% LCI 95% UCI
[1,] 3280 2832 3898
NAs cause problems with mrClosed(). Need to make a catch and send the user a warning.
Here is the issue. In a Schnabel method the first sample will have no marked fish (and thus
m[1]=0
) and it is irrelevant how many marked fish are returned to the population after the last sample (thus, eitherR[length(R)]=0
orR[length(R)]=n[length(n)]
. However, some users may enterNA
values for these positions, which will cause an error as shown below.A better result would be to catch these and replace them with zeroes with a warning sent to the user.
The text was updated successfully, but these errors were encountered: