-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.Rmd
57 lines (41 loc) · 1.98 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# cpmr
<!-- badges: start -->
[![R-CMD-check](https://github.com/psychelzh/cpmr/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/psychelzh/cpmr/actions/workflows/R-CMD-check.yaml)
[![Codecov test coverage](https://codecov.io/gh/psychelzh/cpmr/graph/badge.svg)](https://app.codecov.io/gh/psychelzh/cpmr)
[![CRAN status](https://www.r-pkg.org/badges/version/cpmr)](https://CRAN.R-project.org/package=cpmr)
<!-- badges: end -->
The cpmr package is specifically designed for the analysis of the connectome predictive modeling (CPM) method in R. This package relies on [Rfast](https://CRAN.R-project.org/package=Rfast) to do row oriented calculation.
## Installation
You can install the released version of cpmr from [CRAN](https://CRAN.R-project.org) with:
``` r
install.packages("cpmr")
```
Or you can install the development version of cpmr from [r-universe](https://psychelzh.r-universe.dev) with:
``` r
install.packages("cpmr", repos = c("https://psychelzh.r-universe.dev", getOption("repos")))
```
## 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.
```{r example}
library(cpmr)
withr::local_seed(123)
conmat <- matrix(rnorm(100 * 1000), nrow = 100)
behav <- rnorm(100)
res <- cpm(conmat, behav, kfolds = 10, return_edges = "sum")
res
summary(res)
```
## Code of Conduct
Please note that the cpmr project is released with a [Contributor Code of Conduct](https://psychelzh.github.io/cpmr/CODE_OF_CONDUCT.html). By contributing to this project, you agree to abide by its terms.