Skip to content
This repository was archived by the owner on Feb 21, 2023. It is now read-only.
/ cm Public archive

WIP and only proof of concept

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md
Notifications You must be signed in to change notification settings

TimTaylor/cm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cm

WIP on proof of concept (poc) for a contact matrix class that could underpin various packages (e.g. socialmixr).

Installation

You can install cm from GitHub with:

# install.packages("remotes")
remotes::install_github("TimTaylor/cm")

Example

library(tibble)
library(cm)

dat <- tribble(
        ~age,  ~gender,    ~age,  ~gender, ~value,
     "young",   "male",   "old", "female",     1L,
     "young", "female",   "old", "female",     2L,
       "old", "female", "young", "female",     2L
)

from <- .subset(dat, 1:2)
to <- .subset(dat, 3:4)
value <- .subset2(dat, 5L)

contact_matrix(from, to, value)
#> dimensions: 4 x 4
#> groups:     age, gender
#> 
#>                  [old / female] [old / male] [young / female] [young / male]
#> [old / female]                0            0                2              0
#> [old / male]                  0            0                0              0
#> [young / female]              2            0                0              0
#> [young / male]                1            0                0              0

About

WIP and only proof of concept

Resources

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages