We will download a dataset from the Central Statistics Office and examine the number of PPSN numbers allocated to foreign nationals in recent years.
library(pxR); library(ggplot2); library(dplyr)
#Retrieve data from Central Statistics Office
FNA02 <- read.px("https://www.cso.ie/px/pxeirestat/Database/eirestat/Foreign%20National%20Activity/FNA02.px")
FNA02df <- as.data.frame(FNA02) #convert to data frame
str(FNA02df)
## 'data.frame': 2205 obs. of 4 variables: ## $ Year : Factor w/ 15 levels "2002","2003",..: 1 2 3 4 5 6 7 8 9 10 ... ## $ Year.of.Entry : Factor w/ 21 levels "All PPSN allocations to foreign nationals aged 15 years and over",..: 1 1 1 1 1 1 1 1 1 1 ... ## $ Broad.Nationality.Group: Factor w/ 7 levels "All nationalities",..: 1 1 1 1 1 1 1 1 1 1 ... ## $ value : num 76919 70138 114750 168197 200450 ...