-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.Rmd
196 lines (140 loc) · 5.96 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
---
output: github_document
editor_options:
markdown:
wrap: 72
---
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%",
echo = FALSE,
warning = FALSE,
message = FALSE
)
```
```{r, echo=FALSE, warning=FALSE, message=FALSE}
# Asegúrate de tener el paquete cargado:
pak::pkg_install("iguanamarina/neuroSCC")
library(neuroSCC)
# Para el badge con el numero de contributors
library(httr)
library(gitcreds)
# Token de GitHub
token_info <- gitcreds::gitcreds_get()
token <- token_info$password
mi_paquete <- "neuroSCC"
# URL del endpoint de contribuyentes
url <- "https://api.github.com/repos/iguanamarina/neuroSCC/contributors"
# Haz la solicitud
respuesta <- GET(url, add_headers(Authorization = paste("token", token)))
# Parsea la respuesta como JSON
contribuyentes <- content(respuesta, "parsed")
badge_url <- paste0("https://img.shields.io/badge/Contributors-", length(contribuyentes), "-brightgreen")
# URL del endpoint de issues
url_issues <- "https://api.github.com/repos/iguanamarina/neuroSCC/issues"
# Haz la solicitud
respuesta_issues <- GET(url_issues, add_headers(Authorization = paste("token", token)))
# Parsea la respuesta como JSON
issues <- content(respuesta_issues, "parsed")
# Filtra las issues para obtener solo las que no son pull requests
issues <- issues[is.null(issues$pull_request)]
# Crea la URL de la badge
badge_url_issues <- paste0("https://img.shields.io/badge/Issues-", length(issues), "-brightgreen")
# URL del endpoint de pull requests
url_commits <- "https://api.github.com/repos/iguanamarina/neuroSCC/commits"
commits <- list()
page <- 1
while (TRUE) {
response_commits <- GET(paste0(url_commits, "?page=", page), add_headers(Authorization = paste("token", token)))
data <- content(response_commits, "parsed")
if (length(data) == 0) {
break
}
commits <- c(commits, data)
page <- page + 1
}
# Crea la URL de la badge
badge_url_commits <- paste0("https://img.shields.io/badge/Commits-", length(commits), "-brightgreen")
# Construye la URL de la API
url_size <- paste0("https://api.github.com/repos/iguanamarina", "/", mi_paquete)
# Realiza la solicitud GET
response_size <- GET(url_size, add_headers(Authorization = paste("token", token)))
# Parsea la respuesta como JSON
repo_info <- content(response_size, "parsed")
# Extrae el tamaño del repositorio
repo_size <- repo_info$size
# Crea la URL de la badge
badge_url_size <- paste0("https://img.shields.io/badge/Size-", repo_size, "KB-brightgreen")
# Version del paquete:
version <- as.character(packageVersion("neuroSCC"))
```
<p align="center">
<img src="man/figures/logo.png" alt="neuroSCC R Package" width="250px" align="center"/>
</p>
<h2 align="center" style="font-size:40px;">
neuroSCC R Package (v.`r version`)
</h2>
<!-- Badge de ADMIN IGUANAMARINA -->
<p align="center">
<img src="https://img.shields.io/badge/Admin:-IGUANAMARINA-informational?style=for-the-badge&logo=award" alt="Admin:" style="width:250px;"/>
</p>
<!-- Badges -->
<p align="center">
<img src="http://www.repostatus.org/badges/latest/active.svg" alt="Project Status: Active-El proyecto está siendo activamente desarrollado y puede ser inestable." style="width:125px;"/>
<img src="https://img.shields.io/badge/lifecycle-Stable-4cc71e.svg" alt="Lifecycle: Stable" style="width:100px;"/>
<img src="`r badge_url`" alt="Contributors"/>
<img src="`r badge_url_commits`" alt="Commits"/>
<img src="`r badge_url_issues`" alt="Issues"/>
<img src="`r badge_url_size`" alt="Size"/>
<img src="https://img.shields.io/badge/r-%23276DC3.svg?style=for-the-badge&logo=r&logoColor=white" alt="R" style="width:40px;"/>
</p>
<hr />
<!-- Descripción del paquete -->
::: {style="text-align: justify; font-weight: normal; font-size:15px; padding: 0 10%;"}
**Maintainer:** Juan A. Arias
([*iguanamarina\@protonmail.com*](mailto:[email protected]){.email})
**Main Goal:** To load PET data, re-organize it as a *data.frame*,
estimate Simultaneous Confidence Corridors for one or multiple groups of
patients, and compare them in order to find brain areas whose activity
falls out of estimated confidence intervals, thus evidencing changes in
brain activity in that region compared to the counterpart.
**Description:** This package provides auxiliary functions for
calculating Simultaneous Confidence Corridors (SCCs) on PET neuroimaging
data. It includes functions to load neuroimaging and demographic data in
the standard format required, and assists in various tasks throughout
the process. Overall, this package is designed to help with the
replication process of a cornerstone paper from my thesis "*Development
of statistical methods for neuroimage data analysis towards early
diagnostic of neurodegenerative diseases*" and it is best followed using
the scripts available at [the designated GitHub
Repository](https://github.com/iguanamarina/SCCneuroimage). Overall,
this serves as a support package, although it can work as a stand-alone
package for other projects related to PET imaging.
**References:**
> Wang Y, Wang G, Wang L, Ogden RT. Simultaneous confidence corridors
> for mean functions in functional data analysis of imaging data.
> *Biometrics*. 2020 Jun;76(2):427-437. doi:
> [10.1111/biom.13156](https://pubmed.ncbi.nlm.nih.gov/31544958/). Epub 2019 Nov 6. PMID:
> 31544958; PMCID: PMC7310608.
:::
```{r eval=FALSE, include=FALSE}
#----- Instalación básica del paquete
remotes::install_github("iguanamarina/neuroSCC")
library(neuroSCC)
#----- Correr estas líneas cada vez que pase algo
library(testthat)
library(roxygen2)
library(devtools)
roxygen2::roxygenise()
devtools::document()
pkgload::load_all(".")
devtools::install()
#----- Correr estas cada vez que se suba de versión
usethis::use_version() # actualiza la version
devtools::check() # A menudo da pequeños errores pero sigue dejando tirar
devtools::build_manual(pkg = ".", path = getwd()) # Construye el manual en PDF
devtools::build() # build package en tar.gz
```