nomisr icon indicating copy to clipboard operation
nomisr copied to clipboard

Errors when using ONS codes for some geographic areas

Open cassier-barton opened this issue 3 years ago • 2 comments

There seems to be an issue with nomisr not returning data for certain types of geographic area.

I've been using ONS 9-digit codes to specify 'geography' within the nomis_get_data function (e.g. E92000001 for England) and this normally works great. But for certain geographic areas, it returns an error message.

For example, using the 9-digit code for the Abberton built-up area...

nomis_get_data(id = "NM_2010_1", geography = "E34003718", date = "latest")

... results in the following error message:

Error in if (as.numeric(first_df$RECORD_COUNT)[1] >= max_length) { : missing value where TRUE/FALSE needed In addition: Warning message: Unknown or uninitialised column: RECORD_COUNT.

As far as I can tell this happens for all built-up areas, built-up area subdivisions, wards (post-2011), 'major towns and cities', CCGs and local health boards. I've been looking at this mostly using Nomis' small area based population estimates, but it looks like the the same issue applies with census tables as well.

Thanks for developing nomisr - it's extremely useful.

cassier-barton avatar Apr 01 '21 16:04 cassier-barton