Error When Trying to Truncate using a string

26 views
Skip to first unread message

Sarah Moore Nicholson

unread,
Nov 8, 2015, 1:44:24 PM11/8/15
to distance-sampling
Hello!

I have been trying to truncate my data using;

   >df_hr_All <- ds(distdata, truncation = "10%", key="hr", adjustment=NULL)

and I keep getting this error...

   >Error in quantile.default(data$distance, probs = 1 - (truncation/100)) : missing values and NaN's not allowed if 'na.rm' is FALSE

If I run the model like this;

   >df_hr_All <- ds(distdata, truncation = 10, key="hr", adjustment=NULL)

the model runs fine but I am truncating at 10 meters and I only want to truncate 10%

Thanks for the help! 

Sarah

Eric Rexstad

unread,
Nov 8, 2015, 3:44:44 PM11/8/15
to Sarah Moore Nicholson, distance-sampling

Sarah:


I suspect you have one (or more) transects on which no sightings were made.  When this is the case, there needs to be a record for the transect (so your friend effort is recorded) but the perpendicular distance is set to "NA" (it takes on no value).


Now you are requesting a given percentile of your data be filtered, but the error you are getting states there is a problem with performing the filtering in the presence of the NA values.


This bug was fixed with version 0.9.5 of the Distance R package back in August of 2015.  If you update your version of the R package Distance, you should be back in business.




From: distance...@googlegroups.com <distance...@googlegroups.com> on behalf of Sarah Moore Nicholson <sarah...@gmail.com>
Sent: 08 November 2015 18:44
To: distance-sampling
Subject: [distance-sampling] Error When Trying to Truncate using a string
 
--
You received this message because you are subscribed to the Google Groups "distance-sampling" group.
To unsubscribe from this group and stop receiving emails from it, send an email to distance-sampl...@googlegroups.com.
To post to this group, send email to distance...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/distance-sampling/709db3a1-d2da-4a74-9aaa-4a6bbad677e6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages