Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

some newly internal functions are still used in Rpath data scripts #75

Open
sgaichas opened this issue Aug 5, 2024 · 5 comments
Open

Comments

@sgaichas
Copy link
Member

sgaichas commented Aug 5, 2024

The internal function post_strat is used for some Rpath input data (diet data) outside survdat.

We may want to re-consider exporting this and some other functions (recently made internal in #68), or add them to a different package to allow use outside survdat

@andybeet we can discuss with @SarahJWeisberg and @MaxGrezlik

@andybeet
Copy link
Member

We can do this (move some functions to another location).
So how were these functions being used prior to the survdat change referenced in PR #68 ?

These functions are still accessible if you have survdat installed. Just use survdat:::post_strat (three colons)

@MaxGrezlik
Copy link

MaxGrezlik commented Aug 14, 2024

The function survdat::post_strat was being used in Sean's script to apportion diet data from the trawl survey to GB Rpath groups. After the change, the script still ran but some groups ended up with negative values in their diet composition which is how @SarahJWeisberg caught the issue.

Andy's fix of survdat:::poststrat (three colons) worked. We can discuss if it is worth revising PR #68

@andybeet
Copy link
Member

Looking at the history of this file, it doesn't look like it has been changed in over 4 years, other than what i did recently (which was to just not export the function with the package). So i'm thinking either this issue you are seeing always existed (however you would have probably spotted this problem before now) or the data being passed to the function is different. Probably need to look into this a little more

@MaxGrezlik
Copy link

The error message I was getting when running with two colons survdat::post_strat(stations,GB, 'EPU' was: "Error: 'post_strat' is not an exported object from 'namespace:survdat'"

I'm not sure if that helps solve the mystery.

@andybeet
Copy link
Member

@MaxGrezlik That error is expected since the function is no longer exported. An exported function is one that is available for a user. All exported functions are available by using the ::. Any internal functions, used inside the package, deemed unnecessary for the user to interact with can only be accessed using :::.

I issue i was referring to was the negative diet composition. We need to find out why this is occurring

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants