Skip to content

Commit 99f0d2f

Browse files
authored
Merge pull request #2 from swarm-lab/develop
Develop
2 parents c172136 + 2ec389d commit 99f0d2f

File tree

18 files changed

+225
-110
lines changed

18 files changed

+225
-110
lines changed

.Rbuildignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ cran-comments.md
1111
^CRAN-SUBMISSION$
1212
^codecov\.yml$
1313
revdep
14+
.vscode

.github/workflows/rhub.yaml

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
# R-hub's generic GitHub Actions workflow file. It's canonical location is at
2+
# https://github.com/r-hub/actions/blob/v1/workflows/rhub.yaml
3+
# You can update this file to a newer version using the rhub2 package:
4+
#
5+
# rhub::rhub_setup()
6+
#
7+
# It is unlikely that you need to modify this file manually.
8+
9+
name: R-hub
10+
run-name: "${{ github.event.inputs.id }}: ${{ github.event.inputs.name || format('Manually run by {0}', github.triggering_actor) }}"
11+
12+
on:
13+
workflow_dispatch:
14+
inputs:
15+
config:
16+
description: 'A comma separated list of R-hub platforms to use.'
17+
type: string
18+
default: 'linux,windows,macos'
19+
name:
20+
description: 'Run name. You can leave this empty now.'
21+
type: string
22+
id:
23+
description: 'Unique ID. You can leave this empty now.'
24+
type: string
25+
26+
jobs:
27+
28+
setup:
29+
runs-on: ubuntu-latest
30+
outputs:
31+
containers: ${{ steps.rhub-setup.outputs.containers }}
32+
platforms: ${{ steps.rhub-setup.outputs.platforms }}
33+
34+
steps:
35+
# NO NEED TO CHECKOUT HERE
36+
- uses: r-hub/actions/setup@v1
37+
with:
38+
config: ${{ github.event.inputs.config }}
39+
id: rhub-setup
40+
41+
linux-containers:
42+
needs: setup
43+
if: ${{ needs.setup.outputs.containers != '[]' }}
44+
runs-on: ubuntu-latest
45+
name: ${{ matrix.config.label }}
46+
strategy:
47+
fail-fast: false
48+
matrix:
49+
config: ${{ fromJson(needs.setup.outputs.containers) }}
50+
container:
51+
image: ${{ matrix.config.container }}
52+
53+
steps:
54+
- uses: r-hub/actions/checkout@v1
55+
- uses: r-hub/actions/platform-info@v1
56+
with:
57+
token: ${{ secrets.RHUB_TOKEN }}
58+
job-config: ${{ matrix.config.job-config }}
59+
- uses: r-hub/actions/setup-deps@v1
60+
with:
61+
token: ${{ secrets.RHUB_TOKEN }}
62+
job-config: ${{ matrix.config.job-config }}
63+
- uses: r-hub/actions/run-check@v1
64+
with:
65+
token: ${{ secrets.RHUB_TOKEN }}
66+
job-config: ${{ matrix.config.job-config }}
67+
68+
other-platforms:
69+
needs: setup
70+
if: ${{ needs.setup.outputs.platforms != '[]' }}
71+
runs-on: ${{ matrix.config.os }}
72+
name: ${{ matrix.config.label }}
73+
strategy:
74+
fail-fast: false
75+
matrix:
76+
config: ${{ fromJson(needs.setup.outputs.platforms) }}
77+
78+
steps:
79+
- uses: r-hub/actions/checkout@v1
80+
- uses: r-hub/actions/setup-r@v1
81+
with:
82+
job-config: ${{ matrix.config.job-config }}
83+
token: ${{ secrets.RHUB_TOKEN }}
84+
- uses: r-hub/actions/platform-info@v1
85+
with:
86+
token: ${{ secrets.RHUB_TOKEN }}
87+
job-config: ${{ matrix.config.job-config }}
88+
- uses: r-hub/actions/setup-deps@v1
89+
with:
90+
job-config: ${{ matrix.config.job-config }}
91+
token: ${{ secrets.RHUB_TOKEN }}
92+
- uses: r-hub/actions/run-check@v1
93+
with:
94+
job-config: ${{ matrix.config.job-config }}
95+
token: ${{ secrets.RHUB_TOKEN }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ src/models/*.o
99
src/models/*.so
1010
src/models/*.dll
1111
docs
12+
.vscode/settings.json

DESCRIPTION

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
Package: CEC
22
Type: Package
33
Title: Cross-Entropy Clustering
4-
Version: 0.11.1
5-
Date: 2024-01-08
4+
Version: 0.11.2
5+
Date: 2024-10-10
66
Authors@R: c(
77
person("Kamieniecki", "Konrad", email = "[email protected]",
88
role = c("aut")),
@@ -30,6 +30,6 @@ Imports:
3030
utils
3131
NeedsCompilation: yes
3232
License: GPL-3
33-
RoxygenNote: 7.2.3
33+
RoxygenNote: 7.3.2
3434
Suggests:
3535
covr

NEWS.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
# CEC v0.11.2
2+
3+
## New features
4+
5+
* N/A.
6+
7+
## Minor improvements and fixes
8+
9+
* Fixing CRAN NO_REMAP error with R > 4.5.0.
10+
11+
---
12+
113
# CEC v0.11.1
214

315
## New features

R/CEC-package.R

Lines changed: 4 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -14,75 +14,10 @@
1414
#'
1515
#' @seealso \code{\link{cec}}
1616
#'
17-
#' @keywords package multivariate cluster models
17+
#' @keywords internal package multivariate cluster models
1818
#'
19-
NULL
20-
21-
22-
#' @title Four Gaussian Clusters
23-
#'
24-
#' @description Matrix of 2-dimensional points forming four Gaussian clusters.
25-
#'
26-
#' @name fourGaussians
27-
#'
28-
#' @docType data
29-
#'
30-
#' @keywords datasets
31-
#'
32-
#' @examples
33-
#' data(fourGaussians)
34-
#' plot(fourGaussians, cex = 0.5, pch = 19);
35-
#'
36-
NULL
37-
19+
"_PACKAGE"
3820

39-
#' @title Three Gaussian Clusters
40-
#'
41-
#' @description Matrix of 2-dimensional points forming three Gaussian clusters.
42-
#'
43-
#' @name threeGaussians
44-
#'
45-
#' @docType data
46-
#'
47-
#' @keywords datasets
48-
#'
49-
#' @examples
50-
#' data(threeGaussians)
51-
#' plot(threeGaussians, cex = 0.5, pch = 19);
52-
#'
53-
NULL
54-
55-
56-
#' @title Mixed Shapes Clusters
57-
#'
58-
#' @description Matrix of 2-dimensional points that form circular and elliptical
59-
#' patterns.
60-
#'
61-
#' @name mixShapes
62-
#'
63-
#' @docType data
64-
#'
65-
#' @keywords datasets
66-
#'
67-
#' @examples
68-
#' data(mixShapes)
69-
#' plot(mixShapes, cex = 0.5, pch = 19);
70-
#'
71-
NULL
72-
73-
74-
#' @title T-Shaped Clusters
75-
#'
76-
#' @description Matrix of 2-dimensional points that form the letter T.
77-
#'
78-
#' @name Tset
79-
#'
80-
#' @docType data
81-
#'
82-
#' @keywords datasets
83-
#'
84-
#' @examples
85-
#' data(Tset)
86-
#' plot(Tset, cex = 0.5, pch = 19);
87-
#'
21+
## usethis namespace: start
22+
## usethis namespace: end
8823
NULL

R/cec.R

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
#' Possible values are: "covariance", "fixedr", "spherical", "diagonal",
2727
#' "eigenvalues", "all" (default).
2828
#'
29-
#' Currently, if the \code{centers} argument is a vector, only a single type can
30-
#' be used.
29+
#' Currently, if the \code{centers} argument is a vector, only a single type
30+
#' can be used.
3131
#'
3232
#' @param iter.max The maximum number of iterations of the clustering algorithm.
3333
#'
@@ -62,8 +62,8 @@
6262
#' visible in the results as NA in the "centers" matrix (as well as the
6363
#' corresponding values in the list of covariances).
6464
#'
65-
#' @param interactive If \code{TRUE}, the result of clustering will be plotted after
66-
#' every iteration.
65+
#' @param interactive If \code{TRUE}, the result of clustering will be plotted
66+
#' after every iteration.
6767
#'
6868
#' @param threads The number of threads to use or "auto" to use the default
6969
#' number of threads (usually the number of available processing units/cores)
@@ -344,7 +344,7 @@ cec <- function(x,
344344

345345
card.min <- max(card.min, n + 1)
346346
k <- max(var.centers)
347-
startTime <- proc.time()
347+
# startTime <- proc.time()
348348

349349
centers.r <- list(init.method = init.method.name,
350350
var.centers = as.integer(var.centers),
@@ -378,7 +378,7 @@ cec <- function(x,
378378
}
379379

380380
k.final <- nrow(Z$centers)
381-
execution.time <- as.vector((proc.time() - startTime))[3]
381+
# execution.time <- as.vector((proc.time() - startTime))[3]
382382
Z$centers[is.nan(Z$centers)] <- NA
383383
tab <- tabulate(Z$cluster)
384384
probability <- vapply(tab, function(c.card) {
@@ -427,7 +427,7 @@ cec <- function(x,
427427

428428
structure(
429429
list(data = x, cluster = Z$cluster, centers = Z$centers, probability = probability, cost.function = Z$energy,
430-
nclusters = Z$nclusters, iterations = Z$iterations, time = execution.time, covariances = Z$covariances,
430+
nclusters = Z$nclusters, iterations = Z$iterations, covariances = Z$covariances,
431431
covariances.model = covariances.model, means.model = means.model),
432432
class = "cec")
433433
}

R/utils.R

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,3 +127,72 @@ mouseset <- function(n = 4000, r.head = 2, r.left.ear = 1.1, r.right.ear = 1.1,
127127

128128
M
129129
}
130+
131+
132+
#' @title Four Gaussian Clusters
133+
#'
134+
#' @description Matrix of 2-dimensional points forming four Gaussian clusters.
135+
#'
136+
#' @name fourGaussians
137+
#'
138+
#' @docType data
139+
#'
140+
#' @keywords datasets
141+
#'
142+
#' @examples
143+
#' data(fourGaussians)
144+
#' plot(fourGaussians, cex = 0.5, pch = 19);
145+
#'
146+
NULL
147+
148+
149+
#' @title Three Gaussian Clusters
150+
#'
151+
#' @description Matrix of 2-dimensional points forming three Gaussian clusters.
152+
#'
153+
#' @name threeGaussians
154+
#'
155+
#' @docType data
156+
#'
157+
#' @keywords datasets
158+
#'
159+
#' @examples
160+
#' data(threeGaussians)
161+
#' plot(threeGaussians, cex = 0.5, pch = 19);
162+
#'
163+
NULL
164+
165+
166+
#' @title Mixed Shapes Clusters
167+
#'
168+
#' @description Matrix of 2-dimensional points that form circular and elliptical
169+
#' patterns.
170+
#'
171+
#' @name mixShapes
172+
#'
173+
#' @docType data
174+
#'
175+
#' @keywords datasets
176+
#'
177+
#' @examples
178+
#' data(mixShapes)
179+
#' plot(mixShapes, cex = 0.5, pch = 19);
180+
#'
181+
NULL
182+
183+
184+
#' @title T-Shaped Clusters
185+
#'
186+
#' @description Matrix of 2-dimensional points that form the letter T.
187+
#'
188+
#' @name Tset
189+
#'
190+
#' @docType data
191+
#'
192+
#' @keywords datasets
193+
#'
194+
#' @examples
195+
#' data(Tset)
196+
#' plot(Tset, cex = 0.5, pch = 19);
197+
#'
198+
NULL

man/CEC-package.Rd

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/Tset.Rd

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)