Code
install.packages("tongfen")
The tongfen R package (von Bergmann 2021) facilitates making data on different geometries comparable.
TongFen (通分) means to convert two fractions to the least common denominator, typically in preparation for further manipulation like addition or subtraction. In English, that’s a mouthful and sounds complicated. But in Chinese there is a word for this, TongFen, which makes this process appear very simple.
When working with geospatial datasets we often want to compare data that is given on different regions. For example census data and election data. Or data from two different censuses. To properly compare this data we first need to convert it to a common geography. The process to do this is quite analogous to the process of TongFen for fractions, so we appropriate this term to give it a simple name. Using the tongfen package, preparing data on disparate geographies for comparison by converting them to a common geography is as easy as typing tongfen
.
In particular, the package has a number of convenience functions to facilitate making Canadian census data comparable through time, making it easy to perform longitudinal analysis on fine geographies based on the Canadian Census. Essentially, the tongfen package creates a semi-custom tabulation based on Dissemination Block, Dissemination Area, or Census Tract geographies.
These semi-custom tabulations are created in three steps:
The result of this process is a semi-custom tabulation of the data we want that is created on the fly, at the price of coming on a slightly coarser geography than the original input geographies in cases where geographies had to be joined to create the harmonized geography.
To install the package from CRAN use
install.packages("tongfen")