Skip to content

cat2cat

Handling an Inconsistently Coded Categorical Variable in a Longitudinal Dataset

v0.6.1 · May 17, 2026 · GPL (>= 2) | file LICENSE

Description

Unifying an inconsistently coded categorical variable between two different time points in accordance with a mapping table. The main rule is to replicate the observation if it could be assigned to a few categories. Then using frequencies or statistical methods to approximate the probabilities of being assigned to each of them. This procedure was invented and implemented in the paper by 'Nasinski', 'Majchrowska', and 'Broniatowska' (2020) <doi:10.24425/cejeme.2020.134747>.

Downloads

CRAN

550

Last 30 days

6865th

1.2K

Last 90 days

3.6K

Last year

Trend: +37.5% (30d vs prior 30d)

r2u CRAN

12

Last 30 days

76

Last 90 days

211

Last year

Trend: -60% (30d vs prior 30d)

autoCRAN

14

Last 7 days

43

Last 30 days

3

All-time

autoCRAN-only: this name is served only by autoCRAN, so the count is exact.

CRAN Check Status

13 OK
Show all 13 flavors
Flavor Status
r-devel-linux-x86_64-debian-clang OK
r-devel-linux-x86_64-debian-gcc OK
r-devel-linux-x86_64-fedora-clang OK
r-devel-linux-x86_64-fedora-gcc OK
r-devel-windows-x86_64 OK
r-oldrel-macos-arm64 OK
r-oldrel-macos-x86_64 OK
r-oldrel-windows-x86_64 OK
r-patched-linux-x86_64 OK
r-release-linux-x86_64 OK
r-release-macos-arm64 OK
r-release-macos-x86_64 OK
r-release-windows-x86_64 OK

Check History

OK 13 OK · 0 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE Jun 9, 2026
ERROR 12 OK · 0 NOTE · 0 WARNING · 1 ERROR · 0 FAILURE Jun 8, 2026
ERROR r-devel-linux-x86_64-debian-gcc

examples

Running examples in ‘cat2cat-Ex.R’ failed
The error most likely occurred in:

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: summary_c2c
> ### Title: Adjusted summary for regressions on replicated datasets
> ### Aliases: summar
...[truncated]...
", sprintf("Please install %s package to use the %s model in the cat2cat function.",  : 
  Please install caret package to use the knn model in the cat2cat function.
Calls: cat2cat -> cat2cat_ml -> validate_ml -> delayed_package_load
Execution halted
OK 13 OK · 0 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE May 9, 2026
ERROR 12 OK · 0 NOTE · 0 WARNING · 1 ERROR · 0 FAILURE May 3, 2026
ERROR r-devel-windows-x86_64

tests

Running 'testthat.R' [118s]
Running the tests in 'tests/testthat.R' failed.
Complete output:
  > # This file is part of the standard setup for testthat.
  > # It is recommended that you do not modify it.
  > #
  > # Where should you do additional tes
...[truncated]...
9.     └─base::data.frame(...)
   10.       ├─base::as.data.frame(x[[i]], optional = TRUE)
   11.       └─base::as.data.frame.integer(x[[i]], optional = TRUE)
  
  [ FAIL 3 | WARN 0 | SKIP 0 | PASS 105 ]
  Error:
  ! Test failures.
  Execution halted
OK 14 OK · 0 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE Mar 10, 2026

Code

Structure

Lines of code

7,718

Files

74

Compiled share

0%

Has compiled src

No

Language breakdown

R 2,447 (31.7%)Tests 2,509 (32.5%)Docs 1,404 (18.2%)Vignettes 1,358 (17.6%)

API

Exported functions

11

Internal functions

12

Recent export changes

v0.4.7+1 cat2cat_ml_run

Testing & CI

Has tests

Yes

Test-to-code ratio

1.03

testthat edition

3

CI present

No

CI type

[]

PR gated

No

Docs

Return-value doc rate

100%

\dontrun example ratio

33.3%

Roxygen coverage

100%

Has pkgdown

No

NEWS present

Yes

Health & Security signals

Informational signals; not verdicts.

on.exit coverage

100%

Unsafe pattern score

0

Dep constraint coverage

0%

Secret pattern count

0

Bundled 3rd-party code

2 items

Portability & License

Min R version

3.6

System requirements

C++ standard

License

GPL (>= 2) | file LICENSE

License flags

SPDX valid, not OSI

History

Versions

13

First release

2020-09-22

Latest release

2026-05-17

Avg cadence

79 days

Cold removal rate

100%

Dep drift

11

LOC over versions

v0.1.3: 1,751 LOCv0.1.7: 2,038 LOCv0.2.0: 2,167 LOCv0.2.1: 2,163 LOCv0.3.1: 2,259 LOCv0.3.3: 2,186 LOCv0.4.1: 2,825 LOCv0.4.2: 2,869 LOCv0.4.4: 3,029 LOCv0.4.5: 3,662 LOCv0.4.6: 3,971 LOCv0.4.7: 4,692 LOCv0.6.1: 7,718 LOC

Per-file churn detail lives in the source pipeline: https://github.com/r-observatory/cran-code-metrics.

Dependency Network

Dependencies Reverse dependencies MASS cat2cat

Version History

14 tracked
updated 0.6.1 ← 0.4.7 diff May 17, 2026
new 0.4.7 Mar 10, 2026
updated 0.4.7 ← 0.4.6 diff Jan 21, 2024
updated 0.4.6 ← 0.4.5 diff Jan 31, 2023
updated 0.4.5 ← 0.4.4 diff Sep 24, 2022
updated 0.4.4 ← 0.4.2 diff Aug 30, 2022
updated 0.4.2 ← 0.4.1 diff Aug 4, 2022
updated 0.4.1 ← 0.3.3 diff Jun 7, 2022
updated 0.3.3 ← 0.3.1 diff Mar 10, 2022
updated 0.3.1 ← 0.2.1 diff Feb 5, 2022
updated 0.2.1 ← 0.2.0 diff Mar 26, 2021
updated 0.2.0 ← 0.1.7 diff Dec 7, 2020
updated 0.1.7 ← 0.1.3 diff Nov 28, 2020
new 0.1.3 Sep 21, 2020