pfmc-assessments / PacFIN.Utilities

R code to manipulate data from the PacFIN database for assessments
http://pfmc-assessments.github.io/PacFIN.Utilities
Other
7 stars 2 forks source link

pivot_wider making a list of ages #103

Open chantelwetzel-noaa opened 1 year ago

chantelwetzel-noaa commented 1 year ago

Describe the bug

When trying to pull the biological data for black and canary rockfishes (separately), both pulls encountered the issue of the the age1 (age2,...) being converted into lists by dplyr::pivot_wider. I am not entirely sure what has changed in the pulled data file that is causing this issue. I plan on looking at this more tomorrow but I wanted to post it here just in case.

brianlangseth-NOAA commented 1 year ago

May be that str(age1) indicates something other than a number was entered. Would make sense if new ages were added with an odd field

shcaba commented 1 year ago

Is it worth trying to pull fewer years and see when this error occurs? See if it is it in the most recent year or does it not matter what year is pulled?

On Thu, Mar 23, 2023 at 3:53 PM Brian Langseth @.***> wrote:

May be that str(age1) indicates something other than a number was entered. Would make sense if new ages were added with an odd field

— Reply to this email directly, view it on GitHub https://github.com/pfmc-assessments/PacFIN.Utilities/issues/103#issuecomment-1482015231, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB6IZLTBQOBNDQH7YMZ2BN3W5TH63ANCNFSM6AAAAAAWF2LA2A . You are receiving this because you are subscribed to this thread.Message ID: @.***>

--

Jason M. Cope, Ph.D.Research Fishery Biologist Fishery Resource Analysis and Monitoring Division Northwest Fisheries Science Center 2725 Montlake Blvd. East

Seattle, WA 98112-2013 NOAA Fisheries Affiliate assistant faculty School of Aquatic and Fishery Sciences University of Washington @. @.> (206) 302-2417 www.nmfs.noaa.gov

kellijohnson-NOAA commented 1 year ago

@chantelwetzel-noaa I have had this happen before I just cannot remember why. Hopefully I will remember why this happened. I think it goes back to not having unique identifiers when trying to combine the data. I am pretty sure it is happening here https://github.com/pfmc-assessments/PacFIN.Utilities/blob/689f7dbc6b299e696466290435f85ba861ac7563/R/PullBDS.PacFIN.R#L186-L199

chantelwetzel-noaa commented 1 year ago

@kellijohnson-NOAA Funny cause I remember encountering too but don't recall when or why. That is exactly where it is happening and there is a warning in the stage above about a long list of non-unique ids. Just lovely.

kellijohnson-NOAA commented 1 year ago

Oh the long list on non-unique ids is a problem that is happening in the new data from California. They have duplicate entries and they are trying to figure out why. Brenda knows. That is why I wasn't able to give @iantaylor-NOAA the data that he wanted for the data workshop. I will ping Brenda again and tell her that it is still not fixed.

chantelwetzel-noaa commented 1 year ago

It also looks like PacFIN may be down this morning...