Skip to content

cran/cpmr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cpmr

R-CMD-check Codecov test coverage

The cpmr package is specifically designed for the analysis of the connectome predictive modeling (CPM) method in R. This package relies on Rfast to do row oriented calculation.

Installation

You can install the development version of cpmr from GitHub with:

# install.packages("devtools")
devtools::install_github("psychelzh/cpmr")

Or you can install cpmr from r-universe with:

install.packages("cpmr", repos = c(getOption("repos"), "https://psychelzh.r-universe.dev"))

Example

It is very simple to use this package. Just shape your connectivity matrix as a subjects by edges matrix, i.e., each row contains the correlation matrix (removed diagonal and duplicated values, e.g., lower triangular data) for each subject, and your behavior data a vector and feed them in cpm() function.

library(cpmr)

withr::local_seed(123)
conmat <- matrix(rnorm(100 * 1000), nrow = 100)
behav <- rnorm(100)
res <- cpm(conmat, behav, kfolds = 10)
plot(res$real, res$pred[, "both"], xlab = "Real", ylab = "Predicted")

About

❗ This is a read-only mirror of the CRAN R package repository. cpmr — Connectome Predictive Modelling in R. Homepage: https://github.com/psychelzh/cpmrhttps://psychelzh.github.io/cpmr/ Report bugs for this package: https://github.com/psychelzh/cpmr/issues

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages