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
I want to use it to obtain probability of detection for each of my sightings. However, the predict.dsmodel looks like it is not available in the newest version of the ds package. Are there other functions or packages I can use to obtain these probabilities?
Checking via an MRE, I find this is true, so offered these alternatives:
But it is easy to remedy. You can either use the "triple colon" trick to access functions within a package that are not exported. Or you can simply call the generic function predict that checks what type of model object it has received and call the appropriate function as a result. Here is an example of both (showing they produce identical results) using the amakihi dataset because I wanted a covariate in my detection function model so predict is doing something interesting:
I'm no expert, but it's not clear to me that S3 methods should be in the namespace. See, for example this stackoverflow post from some years ago. I expect there's more recent and definitive advice somewhere, perhaps in the roxygen2 documentation -- @LHMarshall, do you have an opinion here?
Perhaps the confusion on the part of the user is derived from the existence of help for the function predict.dsmodel. By looking at the list of functions in the package, they thought they should be able to call that function
I don't know how to alleviate the confusion.
Yes, seems like a reasonable expectation that a function documented in the help for a package is exported, unless noted otherwise. Let's see if @LHMarshall knows what best practice is around this general issue and the predict method in particular (as well as other "generic" methods associated with objects such as the summary method) otherwise I'll look into it.
Email from a user:
Checking via an MRE, I find this is true, so offered these alternatives:
I presume the function in question should be exported in the next release.
The text was updated successfully, but these errors were encountered: