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

Extracting data for Area Type of "combined authorities" #55

Closed
catriggwalk opened this issue Aug 13, 2018 · 2 comments
Closed

Extracting data for Area Type of "combined authorities" #55

catriggwalk opened this issue Aug 13, 2018 · 2 comments

Comments

@catriggwalk
Copy link

Some Fingertips downloads contain combined authority level data for some indicators - for example the sickness absence indicators 90286 and 90287 – but I have been unable to extract this data using fingertipsR. Am I doing something wrong, or is this not supposed to be possible for some reason? Is this because of issue #51 ?

The following code outputs the data for these indicators at various geographies but not the combined authority grouping:

sick <- fingertips_data(c(90286, 90287), AreaTypeID = 102) %>%
  group_by(IndicatorID) %>%
  filter(TimeperiodSortable == max(TimeperiodSortable) &
           Sex == "Persons")
sick <- sick[order(sick$IndicatorID),]

The AreaTypeID for combined authorities is 126, but when I change the code as follows I get “No data available in table”.

sick <- fingertips_data(c(90286, 90287), AreaTypeID = 126) %>%
  group_by(IndicatorID) %>%
  filter(TimeperiodSortable == max(TimeperiodSortable) &
           Sex == "Persons")
sick <- sick[order(sick$IndicatorID),]

I tried specifying an area code (as below) but that does not return anything either.

sick <- fingertips_data(c(90286, 90287), AreaCode = 'E47000004', AreaTypeID = 126) %>%
  group_by(IndicatorID) %>%
  filter(TimeperiodSortable == max(TimeperiodSortable) &
           Sex == "Persons")
sick <- sick[order(sick$IndicatorID),]

I also tried specifying the ParentAreadTypeID for country (which is 15):

sick <- fingertips_data(c(90286, 90287), AreaTypeID = 126,
                        ParentAreaTypeID = 15) %>%
  group_by(IndicatorID) %>%
  filter(TimeperiodSortable == max(TimeperiodSortable) &
           Sex == "Persons")
sick <- sick[order(sick$IndicatorID),]
@sebastian-fox
Copy link
Member

Thanks for reporting. This is an issue around terminology - I can't think of a better way of naming arguments. Essentially, the ParentAreaTypeID argument is equivalent to Areas grouped by on Fingertips. To extract combined authorities you need to run the following:

sick <- fingertips_data(c(90286, 90287), AreaTypeID = 102, ParentAreaTypeID = 126)

Is that what you're after?

@catriggwalk
Copy link
Author

That's exactly what I needed to know. Thanks @sebastian-fox

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