Skip to contents

Check the differences between the names (or codes) given in input and the names (or codes) of the corresponding selected United Kingdom statistical unit.

Usage

checkNamesUK(id, unit = c("country", "county"), 
             year = c("2020", "2019"), 
             matchWith = c("name", "code"), 
             scale = c("500", "20"), return_logical = FALSE, 
             print = TRUE, use_internet = TRUE)

Arguments

id

character vector with names or codes

unit

the type of European statistical unit to check

year

year of the analysis

matchWith

the type of id to check:

"name"if unit names
"code"if unit code
scale

the scale of the map.

return_logical

a logical value indicating whether nomatched id are returned.

print

a logical value indicating whether print the nomatched names

use_internet

a logical value indicating wheter the coordinates are downloaded from https://github.com/mappinguniverse/geospatial. If FALSE the maps downloaded during package installation will be used.

Details

The function provides a check between id name or code in the dataset and the corresponding selected United Kingdom statistical unit. unit starts from the largest aggregate, "country", to the smallest, "county". Since unit can change over the years, the year of the data has to be provided.

Value

Returns a string vector with nomatched names or a boolean vector indicating whether or not the id matched.

Author

Alessio Serafini

Examples

data("popUK")
ck <- checkNamesUK(popUK$name, unit = "country")
#> Warning: No match found for variables:  united kingdomNo match found for variables:  great britainNo match found for variables:  england and walesNo match found for variables:  north eastNo match found for variables:  county durhamNo match found for variables:  darlingtonNo match found for variables:  hartlepoolNo match found for variables:  middlesbroughNo match found for variables:  northumberlandNo match found for variables:  redcar and clevelandNo match found for variables:  stockton-on-teesNo match found for variables:  tyne and wear (met county)No match found for variables:  gatesheadNo match found for variables:  newcastle upon tyneNo match found for variables:  north tynesideNo match found for variables:  south tynesideNo match found for variables:  sunderlandNo match found for variables:  north westNo match found for variables:  blackburn with darwenNo match found for variables:  blackpoolNo match found for variables:  cheshire eastNo match found for variables:  cheshire west and chesterNo match found for variables:  haltonNo match found for variables:  warringtonNo match found for variables:  cumbriaNo match found for variables:  allerdaleNo match found for variables:  barrow-in-furnessNo match found for variables:  carlisleNo match found for variables:  copelandNo match found for variables:  edenNo match found for variables:  south lakelandNo match found for variables:  greater manchester (met county)No match found for variables:  boltonNo match found for variables:  buryNo match found for variables:  manchesterNo match found for variables:  oldhamNo match found for variables:  rochdaleNo match found for variables:  salfordNo match found for variables:  stockportNo match found for variables:  tamesideNo match found for variables:  traffordNo match found for variables:  wiganNo match found for variables:  lancashireNo match found for variables:  burnleyNo match found for variables:  chorleyNo match found for variables:  fyldeNo match found for variables:  hyndburnNo match found for variables:  lancasterNo match found for variables:  pendleNo match found for variables:  prestonNo match found for variables:  ribble valleyNo match found for variables:  rossendaleNo match found for variables:  south ribbleNo match found for variables:  west lancashireNo match found for variables:  wyreNo match found for variables:  merseyside (met county)No match found for variables:  knowsleyNo match found for variables:  liverpoolNo match found for variables:  seftonNo match found for variables:  st. helensNo match found for variables:  wirralNo match found for variables:  yorkshire and the humberNo match found for variables:  east riding of yorkshireNo match found for variables:  kingston upon hull, city ofNo match found for variables:  north east lincolnshireNo match found for variables:  north lincolnshireNo match found for variables:  yorkNo match found for variables:  north yorkshireNo match found for variables:  cravenNo match found for variables:  hambletonNo match found for variables:  harrogateNo match found for variables:  richmondshireNo match found for variables:  ryedaleNo match found for variables:  scarboroughNo match found for variables:  selbyNo match found for variables:  south yorkshire (met county)No match found for variables:  barnsleyNo match found for variables:  doncasterNo match found for variables:  rotherhamNo match found for variables:  sheffieldNo match found for variables:  west yorkshire (met county)No match found for variables:  bradfordNo match found for variables:  calderdaleNo match found for variables:  kirkleesNo match found for variables:  leedsNo match found for variables:  wakefieldNo match found for variables:  east midlandsNo match found for variables:  derbyNo match found for variables:  leicesterNo match found for variables:  north northamptonshire No match found for variables:  nottinghamNo match found for variables:  rutlandNo match found for variables:  west northamptonshire No match found for variables:  derbyshireNo match found for variables:  amber valleyNo match found for variables:  bolsoverNo match found for variables:  chesterfieldNo match found for variables:  derbyshire dalesNo match found for variables:  erewashNo match found for variables:  high peakNo match found for variables:  north east derbyshireNo match found for variables:  south derbyshireNo match found for variables:  leicestershireNo match found for variables:  blabyNo match found for variables:  charnwoodNo match found for variables:  harboroughNo match found for variables:  hinckley and bosworthNo match found for variables:  meltonNo match found for variables:  north west leicestershireNo match found for variables:  oadby and wigstonNo match found for variables:  lincolnshireNo match found for variables:  bostonNo match found for variables:  east lindseyNo match found for variables:  lincolnNo match found for variables:  north kestevenNo match found for variables:  south hollandNo match found for variables:  south kestevenNo match found for variables:  west lindseyNo match found for variables:  nottinghamshireNo match found for variables:  ashfieldNo match found for variables:  bassetlawNo match found for variables:  broxtoweNo match found for variables:  gedlingNo match found for variables:  mansfieldNo match found for variables:  newark and sherwoodNo match found for variables:  rushcliffeNo match found for variables:  west midlandsNo match found for variables:  herefordshire, county ofNo match found for variables:  shropshireNo match found for variables:  stoke-on-trentNo match found for variables:  telford and wrekinNo match found for variables:  staffordshireNo match found for variables:  cannock chaseNo match found for variables:  east staffordshireNo match found for variables:  lichfieldNo match found for variables:  newcastle-under-lymeNo match found for variables:  south staffordshireNo match found for variables:  staffordNo match found for variables:  staffordshire moorlandsNo match found for variables:  tamworthNo match found for variables:  warwickshireNo match found for variables:  north warwickshireNo match found for variables:  nuneaton and bedworthNo match found for variables:  rugbyNo match found for variables:  stratford-on-avonNo match found for variables:  warwickNo match found for variables:  west midlands (met county)No match found for variables:  birminghamNo match found for variables:  coventryNo match found for variables:  dudleyNo match found for variables:  sandwellNo match found for variables:  solihullNo match found for variables:  walsallNo match found for variables:  wolverhamptonNo match found for variables:  worcestershireNo match found for variables:  bromsgroveNo match found for variables:  malvern hillsNo match found for variables:  redditchNo match found for variables:  worcesterNo match found for variables:  wychavonNo match found for variables:  wyre forestNo match found for variables:  eastNo match found for variables:  bedfordNo match found for variables:  central bedfordshireNo match found for variables:  lutonNo match found for variables:  peterboroughNo match found for variables:  southend-on-seaNo match found for variables:  thurrockNo match found for variables:  cambridgeshireNo match found for variables:  cambridgeNo match found for variables:  east cambridgeshireNo match found for variables:  fenlandNo match found for variables:  huntingdonshireNo match found for variables:  south cambridgeshireNo match found for variables:  essexNo match found for variables:  basildonNo match found for variables:  braintreeNo match found for variables:  brentwoodNo match found for variables:  castle pointNo match found for variables:  chelmsfordNo match found for variables:  colchesterNo match found for variables:  epping forestNo match found for variables:  harlowNo match found for variables:  maldonNo match found for variables:  rochfordNo match found for variables:  tendringNo match found for variables:  uttlesfordNo match found for variables:  hertfordshireNo match found for variables:  broxbourneNo match found for variables:  dacorumNo match found for variables:  east hertfordshireNo match found
str(ck)
#>  chr [1:416] "united kingdom" "great britain" "england and wales" ...