forked from Alar0g/RFCLUST
-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.Rmd
57 lines (40 loc) · 1.45 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
---
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%"
)
```
# `RFCLUST`
<!-- badges: start -->
[![R-CMD-check](https://github.com/Alar0g/RFCLUST/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/Alar0g/RFCLUST/actions/workflows/R-CMD-check.yaml)
<!-- badges: end -->
`RFCLUST` performs Random Forests of Divisive Monothetic ([`divclust`](https://github.com/chavent/divclust)) Trees for Unsupervised Clustering.
## Installation
You can install the development version of RFCLUST from [GitHub](https://github.com/).
`RFCLUST`depends on a custopmized implementation of the [`divclust`](https://github.com/chavent/divclust) package, that must first be installed with the following:
```{r, eval=FALSE}
# install.packages("remotes")
remotes::install_github("Alar0g/divclust")
```
Then, `RFCLUST` can be installed with:
```{r, eval=FALSE}
remotes::install_github("Alar0g/RFCLUST")
```
## Example
```{r}
library(RFCLUST)
library(palmerpenguins)
mypeng <- as.data.frame(penguins)
mypeng$year <- factor(as.character(mypeng$year),
levels=c("2007", "2008", "2009"),
ordered=TRUE)
forest_clust <- rfclust(na.omit(mypeng[mypeng$sex=="male", -c(1, 7)]), ntrees = 50, ncores = 1)
resume <- summary(forest_clust)
plot(resume)
```