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

fingertips_data() not pulling data that is in API #109

Open
liamfitzpatrick9 opened this issue Nov 8, 2022 · 2 comments
Open

fingertips_data() not pulling data that is in API #109

liamfitzpatrick9 opened this issue Nov 8, 2022 · 2 comments

Comments

@liamfitzpatrick9
Copy link

liamfitzpatrick9 commented Nov 8, 2022

Hi!
Thanks for this fantastic package.

I am trying to access data that is definitely in the Fingertips API, but the fingertips_data() function is returning a blank when trying to bring it through. In the specific example indicator (IndicatorID = 90777), it is able to bring data through at other geographies, but not at regional level, despite these data being in the API when directly querying it on fingertips.phe.org.uk/api. Even when running the function with AreaTypeID = "All", the regional data (Government Office region, not PHE region/centre) do not appear in the resulting dataframe. Similar indicators (such as 90776) do bring data in at regional level, so I am unsure why specifically this one is not working.

Any help or guidance would be greatly appreciated.

EoE.chlam.prop <- fingertips_data(90777, AreaCode = "E12000006", AreaTypeID = 6)    # returns a blank dataframe
All.chlam.prop <- fingertips_data(90777,  AreaTypeID = "All")    # regional data not present
@sebastian-fox
Copy link
Member

Hi @liamfitzpatrick9 - glad you like the package.
This is a strange one and I need to go to the Fingertips team to follow up. I can see that there is data there for Regions, and the work around to access it is this:

EoE.chlam.prop <- fingertips_data(90777, 
                                  AreaTypeID = 402,
                                  ParentAreaTypeID = 6) |> 
  filter(AreaType == "Region")

The following function doesn't seem to recognise that regions are available:

ind_ats <- indicator_areatypes(90777)

This function supports AreaTypeID = "All" in your examples, which is why that option doesn't work.

I hope the work around is ok for you now, and I'll hopefully get to the bottom of why Region doesn't work when supplied as AreaTypeID.

@liamfitzpatrick9
Copy link
Author

Thanks for getting back to me so quickly and with a great work-around, @sebastian-fox. Really appreciate it!

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

2 participants