---
title: "Clustering data"
output: rmarkdown::html_vignette
vignette: >
  %\VignetteIndexEntry{Clustering data}
  %\VignetteEngine{knitr::rmarkdown}
  %\VignetteEncoding{UTF-8}
---

```{r, include = FALSE}
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)
```

```{r setup}
library(cardinalR)
library(langevitour)
```

```{r}
gau_data <- gau_clust(n = 500, num_clust = 5, 
mean_matrix = rbind(c(1,0,0,0), c(0,1,0,0), c(0,0,1,0), c(0,0,0,1), c(0,0,0,0)), 
var_vec = c(0.05, 0.05, 0.05, 0.05, 0.05), num_dims = 4, num_noise = 2, 
min_n = -0.05, max_n = 0.05)

colnames(gau_data) <- paste0("x", 1:NCOL(gau_data))

langevitour(gau_data, pointSize = 2)
```

```{r}
gau_diff_data <- gau_clust_diff(n = 500, 
clust_size_vec = c(50, 100, 200, 150), num_clust = 4, 
mean_matrix = rbind(c(1,0,0,0,0,0), c(0,1,0,0,0,0), c(0,0,1,0,0,0), c(0,0,0,1,0,0)),
var_vec = c(0.02, 0.05, 0.06, 0.1), 
num_dims = 6, num_noise = 4, min_n = -0.05, max_n = 0.05)

colnames(gau_diff_data) <- paste0("x", 1:NCOL(gau_diff_data))

langevitour(gau_diff_data, pointSize = 2)
```

```{r}
clust_diff_shape_data <- clust_diff_shapes(n = 600, 
num_gau_clust = 4, num_non_gau_clust = 2, 
clust_sd_gau = 0.05, clust_sd_non_gau = 0.1,
num_dims = 7, a = 2, b = 4)

colnames(clust_diff_shape_data) <- paste0("x", 1:NCOL(clust_diff_shape_data))

langevitour(clust_diff_shape_data, pointSize = 2)
```

```{r}
clust_diff_shapep_data <- clust_diff_shapes_pts(n = 600,
clust_size_vec = c(150, 75, 50, 75, 150, 100), num_gau_clust = 4,
num_non_gau_clust = 2, clust_sd_gau = 0.05, clust_sd_non_gau = 0.1,
num_dims = 7, a = 3, b = 5)

colnames(clust_diff_shapep_data) <- paste0("x", 1:NCOL(clust_diff_shapep_data))

langevitour(clust_diff_shapep_data, pointSize = 2)
```

```{r}
clust_curvebkg_data <- gau_curvy_clust_bkg(n = 660,
num_noise = 2, min_n = -0.05, max_n = 0.05)

colnames(clust_curvebkg_data) <- paste0("x", 1:NCOL(clust_curvebkg_data))

langevitour(clust_curvebkg_data, pointSize = 2)
```

```{r}
one_doublet_data <- one_doublet(n = 330, 
num_noise = 2, min_n = -0.05, max_n = 0.05)

colnames(one_doublet_data) <- paste0("x", 1:NCOL(one_doublet_data))

langevitour(one_doublet_data, pointSize = 2)
```

```{r}
three_doublet_data <- three_doublets(n = 630, num_noise = 2,
min_n = -0.05, max_n = 0.05)

colnames(three_doublet_data) <- paste0("x", 1:NCOL(three_doublet_data))

langevitour(three_doublet_data, pointSize = 2)
```

```{r}
one_doublet_clust_data <- one_doublet_four_clust(n = 660,
num_noise = 2, min_n = -0.05, max_n = 0.05)

colnames(one_doublet_clust_data) <- paste0("x", 1:NCOL(one_doublet_clust_data))

langevitour(one_doublet_clust_data, pointSize = 2)
```

```{r}
one_doublet_diffv_data <- one_doublet_diff_var_clust(n = 390,
num_noise = 2, min_n = -0.05, max_n = 0.05)

colnames(one_doublet_diffv_data) <- paste0("x", 1:NCOL(one_doublet_diffv_data))

langevitour(one_doublet_diffv_data, pointSize = 2)
```

```{r}
one_doublet_diff_data <- one_doublet_diff_patterns(n = 630, 
num_noise = 2, min_n = -0.05, max_n = 0.05)

colnames(one_doublet_diff_data) <- paste0("x", 1:NCOL(one_doublet_diff_data))

langevitour(one_doublet_diff_data, pointSize = 2)
```

```{r}
two_doublet_para_data <- two_doublets_parallel(n = 660, 
num_noise = 2, min_n = -0.05, max_n = 0.05)

colnames(two_doublet_para_data) <- paste0("x", 1:NCOL(two_doublet_para_data))

langevitour(two_doublet_para_data, pointSize = 2)
```

```{r}
one_doublet_data <- one_doublet_bkg(n = 500, num_noise = 2,
min_n = -0.05, max_n = 0.05)

colnames(one_doublet_data) <- paste0("x", 1:NCOL(one_doublet_data))

langevitour(one_doublet_data, pointSize = 2)
```

```{r}
two_doublet_data <- two_doublets_bkg(n = 500, num_noise = 2,
min_n = -0.05, max_n = 0.05)

colnames(two_doublet_data) <- paste0("x", 1:NCOL(two_doublet_data))

langevitour(two_doublet_data, pointSize = 2)
```

```{r}
two_nonlinear_data <- two_nonlinear(n = 500, num_noise = 2,
min_n = -0.05, max_n = 0.050)

colnames(two_nonlinear_data) <- paste0("x", 1:NCOL(two_nonlinear_data))

langevitour(two_nonlinear_data, pointSize = 2)
```

```{r}
three_curv_data <- two_curvy(n = 500, num_noise = 2,
min_n = -0.05, max_n = 0.05)

colnames(three_curv_data) <- paste0("x", 1:NCOL(three_curv_data))

langevitour(three_curv_data, pointSize = 2)
```

```{r}
three_curv_diff_data <- two_curvy_diff_pts(cluster_size_vec = c(50, 100), 
num_noise = 2, min_n = -0.05, max_n = 0.05)

colnames(three_curv_diff_data) <- paste0("x", 1:NCOL(three_curv_diff_data))

langevitour(three_curv_diff_data, pointSize = 2)
```

```{r}
three_nonlinear_data <- three_nonlinear(n = 330, 
num_noise = 2, min_n = -0.05, max_n = 0.05)

colnames(three_nonlinear_data) <- paste0("x", 1:NCOL(three_nonlinear_data))

langevitour(three_nonlinear_data, pointSize = 2)
```

```{r}
three_mir_data <- three_clust_mirror(n = 720, num_noise = 2,
min_n = -0.05, max_n = 0.05)

colnames(three_mir_data) <- paste0("x", 1:NCOL(three_mir_data))

langevitour(three_mir_data, pointSize = 2)
```

```{r}
curve_clust_data <- gau_curvy_clust(n = 500, 
clust_size_vec = c(150, 350), num_noise = 2, min_n = -0.05,
max_n = 0.05)

colnames(curve_clust_data) <- paste0("x", 1:NCOL(curve_clust_data))

langevitour(curve_clust_data, pointSize = 2)
```

```{r}
three_clust_data <- three_clust_diff_dist(n = 660, num_dims = 6,
num_noise = 2, min_n = -0.05, max_n = 0.05)

colnames(three_clust_data) <- paste0("x", 1:NCOL(three_clust_data))

langevitour(three_clust_data, pointSize = 2)
```
