ropensci/nomisr

Trouble downloading data

Closed this issue · 2 comments

Hello Evan. Thanks for the excellent R library.

I'm trying to download commute data, for London, by MSOA, by mode of transport. Through doing this ...

workplace <- nomis_search(keywords = "*workplace*")

... I believe the table ID I want is 'NM_1208_1'. After that, I'm a bit stumped though. Could you provide any tips or ideas please?

nomis_get_metadata("NM_1208_1", "measures")

# A tibble: 1 x 3
  id    label.en description.en
  <chr> <chr>    <chr>         
1 20100 value    value 

Geography?

nomis_get_metadata("NM_1208_1", "geography", "TYPE")
# A tibble: 0 x 0

The resulting data will be quite large, so I expect I might have to download it Borough by Borough in a loop or something, but I can't get that far to start doing that yet.

Thanks,

JimShady

Hi Jim,

"NM_1208_1" doesn't have a GEOGRAPHY concept, it has USUAL_RESIDENCE and PLACE_OF_WORK:

nomis_get_metadata("NM_1208_1")
# A tibble: 5 x 3
  codelist                     conceptref         isfrequencydimension
  <chr>                        <chr>              <chr>               
1 CL_1208_1_USUAL_RESIDENCE    USUAL_RESIDENCE    false               
2 CL_1208_1_PLACE_OF_WORK      PLACE_OF_WORK      false               
3 CL_1208_1_TRANSPORT_POWPEW11 TRANSPORT_POWPEW11 false               
4 CL_1208_1_MEASURES           MEASURES           false               
5 CL_1208_1_FREQ               FREQ               true   

Using those should work for you, as below:

nomis_get_metadata("NM_1208_1", "USUAL_RESIDENCE", "TYPE")
# A tibble: 4 x 3
  id      label.en                                     description.en                              
  <chr>   <chr>                                        <chr>                                       
1 TYPE270 2011 census merged local authority districts 2011 census merged local authority districts
2 TYPE297 2011 super output areas - middle layer       2011 super output areas - middle layer      
3 TYPE480 regions                                      regions                                     
4 TYPE499 countries                                    countries     

Let me know if you run into any more issues downloading the data.

Thanks for the help @evanodell .