The hardware and bandwidth for this mirror is donated by dogado GmbH, the Webhosting and Full Service-Cloud Provider. Check out our Wordpress Tutorial.
If you wish to report a bug, or if you are interested in having us mirror your free-software or open-source project, please feel free to contact us at mirror[@]dogado.de.

csodata quick start guide

2023-08-11

Introduction

This guide provides a basic overview of the use of the csodata package for new users. Install (if necessary) and load the package:

# # Install or update the package:
# install.packages("csodata")

library(csodata)

Table of Contents

A list of all the table available on the cso StatBank can be downloaded with cso_get_toc. You can search throught the title field using cso_search_toc. (A “Loaded cached toc” or “Loaded cached data” message indicates that the data was retrieved from the cache, instead of being downloaded again.)

toc <- cso_get_toc()
head(toc)
#>          LastModified
#> 1 2023-03-15 11:00:00
#> 2 2023-03-15 11:00:00
#> 3 2023-03-03 11:00:00
#> 4 2023-03-03 11:00:00
#> 5 2023-03-03 11:00:00
#> 6 2023-03-06 11:00:00
#>                                                                                                                                                title
#> 1 Residential Dwelling Property Transactions by Type of Dwelling, Dwelling Status, Sectoral Flow, Stamp Duty Event, Type of Sale, Year and Statistic
#> 2                                                                                   Market-based Non-Household Transactions of Residential Dwellings
#> 3                                                                                   Persons aged 15 years and over with two or more chronic diseases
#> 4                                                         Overall daily volume of antibiotics prescribed in primary care (DDDs) per 1,000 population
#> 5                                                                                Irish speakers aged 3 years and over by frequency of speaking Irish
#> 6                                                                                     Private households by socio-economic group of reference person
#>               id
#> 1          HPA09
#> 2          HPA12
#> 3        HSPAA38
#> 4       HSPAE139
#> 5 SAP2011T3T2CLT
#> 6 SAP2011T9T2CLT

Downloading Data

To download a dataset, use cso_get_data and include a table code from the table of contents.

tbl1 <- cso_get_data("PEA19")

Metadata can be also downloaded or displayed to console:

meta1 <- cso_get_meta("CDP06")
cso_disp_meta("CDP06")
#> Loaded cached data
#> *** METADATA ***
#> CSO Table = Annual Estimated Net Migration 1951 to 2011 per 1,000 of Average Population
#> Units = Number
#> Copyright = Central Statistics Office, Ireland
#> Time interval in data = Intercensal Period
#> Are these statistics experimental? -FALSE
#> Date last modified = 2020-10-30T11:00:00Z
#> Variables:
#> [1] "Intercensal Period" "Province or County" "Year"
#> 
#> Statistics:
#> [1] "Annual Estimated Net Migration 1951 to 2011 per 1,000 of Average Population"
#> 
#> Geographic Data:
#> [1] FALSE

Geographic Data

Geographic vector data in ESRI shapefile format can be downloaded for use in mapping. This is a map of county councils and other local authorities in Ireland, there are many other maps available.

shp <- cso_get_geo("County Councils")
#> Reading layer `2019_Local_Authorities' from data source 
#>   `C:\Users\crowleyco\AppData\Local\Temp\Rtmp8IxBy5\2019_Local_Authorities.shp' 
#>   using driver `GeoJSON'
#> Simple feature collection with 31 features and 2 fields
#> Geometry type: MULTIPOLYGON
#> Dimension:     XY
#> Bounding box:  xmin: -10.68088 ymin: 51.41991 xmax: -5.996287 ymax: 55.44662
#> Geodetic CRS:  WGS 84

This data can be plotted using the leaflet package. Here we plot the outline of each region.

# install.packages("leaflet")
library(leaflet)


leaflet(shp) %>% 
  addTiles() %>% 
  addPolygons()

The data which has been cached locally can be manually cleared once we are done with it.

cso_clear_cache()

These binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.
Health stats visible at Monitor.