Title: | Clustering with Overlaps |
---|---|
Description: | Provide functions for overlaps clustering, fuzzy clustering and interval-valued data manipulation. The package implement the following algorithms: OKM (Overlapping Kmeans) from Cleuziou, G. (2007) <doi:10.1109/icpr.2008.4761079> ; NEOKM (Non-exhaustive overlapping Kmeans) from Whang, J. J., Dhillon, I. S., and Gleich, D. F. (2015) <doi:10.1137/1.9781611974010.105> ; Fuzzy Cmeans from Bezdek, J. C. (1981) <doi:10.1007/978-1-4757-0450-1> ; Fuzzy I-Cmeans from de A.T. De Carvalho, F. (2005) <doi:10.1016/j.patrec.2006.08.014>. |
Authors: | Guillaume Cleuziou [aut], Nicolas Hiot [cre] |
Maintainer: | Nicolas Hiot <[email protected]> |
License: | GPL (>= 2) |
Version: | 1.0.4 |
Built: | 2024-10-22 07:20:19 UTC |
Source: | CRAN |
Converts an interval object to an array representation.
## S3 method for class 'interval' as.array(x, ...)
## S3 method for class 'interval' as.array(x, ...)
x |
An interval object to be converted. |
... |
Additional arguments to be passed to as.array(). |
An array representation of the interval.
as.array(inter_city)
as.array(inter_city)
Converts an interval object to a data frame representation.
## S3 method for class 'interval' as.data.frame(x, ...)
## S3 method for class 'interval' as.data.frame(x, ...)
x |
An interval object to be converted. |
... |
dditional arguments to be passed to as.data.frame(). |
A data frame representation of the interval.
as.data.frame(inter_city)
as.data.frame(inter_city)
A generic function to convert various R objects into interval objects.
as.interval(x)
as.interval(x)
x |
An R object to be converted to an interval. |
An interval object constructed from the R object or NULL if the type is not supported.
The array must have three dimensions, with the second dimension of size 2, representing the minimum and maximum values.
## S3 method for class 'array' as.interval(x)
## S3 method for class 'array' as.interval(x)
x |
An array to be converted to an interval object. |
An interval object constructed from the array if it meets the requirements, otherwise attempts to convert it to a matrix first.
as.interval(array(1:12, dim = c(2, 2, 3)))
as.interval(array(1:12, dim = c(2, 2, 3)))
Provides a default method for converting unsupported data types to interval.
## Default S3 method: as.interval(x)
## Default S3 method: as.interval(x)
x |
An object that does not have a supported conversion method. |
'NULL', indicating no conversion is possible.
Identity Conversion for Interval
## S3 method for class 'interval' as.interval(x)
## S3 method for class 'interval' as.interval(x)
x |
An interval object. |
The input interval object, without modification.
as.interval(inter_city)
as.interval(inter_city)
The number of columns in the matrix must be even, representing pairs of minimum and maximum values.
## S3 method for class 'matrix' as.interval(x)
## S3 method for class 'matrix' as.interval(x)
x |
A matrix where each pair of columns represents the minimum and maximum bounds of intervals. |
An interval object constructed from the matrix.
as.interval(matrix(1:12, 3, 4))
as.interval(matrix(1:12, 3, 4))
The length of the numeric vector must be even, representing pairs of minimum and maximum values.
## S3 method for class 'numeric' as.interval(x)
## S3 method for class 'numeric' as.interval(x)
x |
A numeric vector where each consecutive pair of values represents an interval. |
An interval object constructed from the numeric vector.
as.interval(1:6)
as.interval(1:6)
Each interval is expanded into its minimum and maximum bounds.
## S3 method for class 'interval' as.matrix(x, ...)
## S3 method for class 'interval' as.matrix(x, ...)
x |
An interval object to be converted. |
... |
Additional arguments to be passed to as.vector(). |
A matrix representation of the interval, with two columns for each interval's minimum and maximum values.
as.matrix(inter_city)
as.matrix(inter_city)
Converts an interval object to its vector representation.
## S3 method for class 'interval' as.vector(x, ...)
## S3 method for class 'interval' as.vector(x, ...)
x |
An interval object to be converted. |
... |
Additional arguments to be passed to as.vector(). |
A numeric vector where each consecutive pair of values represents an interval.
as.vector(inter_city)
as.vector(inter_city)
Generates a color for each data point based on its clustering assignment, facilitating visual distinction of clusters in plots.
cluster_color(x)
cluster_color(x)
x |
A clustering vector or a matrix. If a vector is provided, it represents the cluster assignments for each data point. If a matrix is provided, each row should represent a data point's membership across multiple clusters. |
A character vector of colors (in hexadecimal format) corresponding to the clustering assignments, suitable for use in plotting functions.
plot(iris[, 1:2], col = cluster_color(neokm(iris, 2, 0.2, 0.05)$cluster))
plot(iris[, 1:2], col = cluster_color(neokm(iris, 2, 0.2, 0.05)$cluster))
Transforms a matrix of membership degrees into a logical matrix based on a specified threshold.
degree2logical(x, t = min(apply(x, 1, max)))
degree2logical(x, t = min(apply(x, 1, max)))
x |
A matrix of membership degrees. |
t |
Threshold value for converting the degrees to logical values. By default, it uses the minimum of the maximum values in each row. |
A logical matrix where each element is 'TRUE' if it meets or exceeds the threshold, and 'FALSE' otherwise.
degrees <- matrix(runif(9), nrow = 3) degree2logical(degrees, t = 0.5)
degrees <- matrix(runif(9), nrow = 3) degree2logical(degrees, t = 0.5)
Performs fuzzy c-means clustering on interval data, allowing for soft clustering of data points into multiple clusters.
fuzzy_icmeans( x, centers, m = 2, nstart = 2, distance = "euclid", trace = FALSE, iter.max = 40 )
fuzzy_icmeans( x, centers, m = 2, nstart = 2, distance = "euclid", trace = FALSE, iter.max = 40 )
x |
A 3D interval array representing the data to be clustered. |
centers |
Either the number of clusters or a set of pre-initialized cluster centers. If a number is provided, it specifies how many clusters to create. |
m |
A number greater than 1 that controls the degree of fuzziness in the clustering process (default is 2). |
nstart |
Number of times to run the clustering algorithm with different starting values to find the best solution (default is 2). |
distance |
A string specifying the distance metric to use, either 'euclid' for Euclidean distance or 'hausdorff' for Hausdorff distance (default is 'euclid'). |
trace |
Logical, if 'TRUE', tracing information on the progress of the algorithm is displayed (default is 'FALSE'). |
iter.max |
Maximum number of iterations allowed for the clustering algorithm (default is 40). |
A list of clustering results, including: - 'cluster': The membership matrix indicating the degree of belonging of each data point to each cluster. - 'centers': The final cluster centers. - 'totss': Total sum of squares. - 'withinss': Within-cluster sum of squares by cluster. - 'tot.withinss': Total within-cluster sum of squares. - 'betweenss': Between-cluster sum of squares. - 'size': Sizes of each cluster. - 'iter': Number of iterations run by the algorithm. - 'overlaps': The average overlap among clusters.
fuzzy_icmeans(iaggregate(iris, col = 5), 2) fuzzy_icmeans(iaggregate(iris, col = 5), iaggregate(iris, col = 5))
fuzzy_icmeans(iaggregate(iris, col = 5), 2) fuzzy_icmeans(iaggregate(iris, col = 5), iaggregate(iris, col = 5))
Aggregates data into a 3D interval array based on a specified column.
iaggregate(data, col = 1)
iaggregate(data, col = 1)
data |
The data frame to aggregate. |
col |
The index of the column to aggregate by. |
A structured interval object representing the aggregated data.
iaggregate(iris, col = 5) iaggregate(rock, col = 4) iaggregate(cars, col = 1)
iaggregate(iris, col = 5) iaggregate(rock, col = 4) iaggregate(cars, col = 1)
Combines multiple interval objects into a single interval object.
ibind(..., class = FALSE)
ibind(..., class = FALSE)
... |
Interval objects to bind together. |
class |
Logical value indicating whether to assign a new class label to each interval object when binding. If 'TRUE', each set of intervals will have a distinct class label. |
A new interval object containing the combined intervals from the input objects.
ibind(iaggregate(iris, 5), iaggregate(iris, 5)) ibind(iaggregate(iris, 5), iaggregate(iris, 5), iaggregate(iris, 5), class = TRUE)
ibind(iaggregate(iris, 5), iaggregate(iris, 5)) ibind(iaggregate(iris, 5), iaggregate(iris, 5), iaggregate(iris, 5), class = TRUE)
Creates intervals from Normal Distribution using specified mean and standard deviation values for both the center and half-size of the intervals.
igenerate(n, ...)
igenerate(n, ...)
n |
Number of intervals to generate. |
... |
Vectors representing parameters for generating intervals: each vector should contain four values ('center mean', 'center sd', 'half-size mean', 'half-size sd'). |
An interval object containing the generated intervals.
igenerate(1, c(0, 1, 2, 1)) igenerate(1, c(0, 1, 2, 1), c(100, 1, 2, 1))
igenerate(1, c(0, 1, 2, 1)) igenerate(1, c(0, 1, 2, 1), c(100, 1, 2, 1))
Performs k-means clustering on interval data, allowing for partitioning of data points into distinct clusters.
ikmeans( x, centers, nstart = 10, distance = "euclid", trace = FALSE, iter.max = 20 )
ikmeans( x, centers, nstart = 10, distance = "euclid", trace = FALSE, iter.max = 20 )
x |
A 3D interval array representing the data to be clustered. |
centers |
Either the number of clusters to create or a set of pre-initialized cluster centers. If a number is provided, it specifies how many clusters to create. |
nstart |
The number of times to run the k-means algorithm with different starting values in order to find the best solution (default is 10). |
distance |
A string specifying the distance metric to use: 'euclid' for Euclidean distance or 'hausdorff' for Hausdorff distance (default is 'euclid'). |
trace |
Logical value indicating whether to show progress of the algorithm (default is 'FALSE'). |
iter.max |
Maximum number of iterations allowed for the k-means algorithm (default is 20). |
A list of clustering results, including: - 'cluster': A vector indicating the cluster assignment of each data point. - 'centers': The final cluster centers. - 'totss': Total sum of squares. - 'withinss': Within-cluster sum of squares by cluster. - 'tot.withinss': Total within-cluster sum of squares. - 'betweenss': Between-cluster sum of squares. - 'size': The number of points in each cluster. - 'iter': Number of iterations the algorithm executed.
ikmeans(iaggregate(iris, col = 5), 2) ikmeans(iaggregate(iris, col = 5), iaggregate(iris, col = 5))
ikmeans(iaggregate(iris, col = 5), 2) ikmeans(iaggregate(iris, col = 5), iaggregate(iris, col = 5))
Performs clustering on interval data using the Neo-KM algorithm, which allows for overlapping and non-exhaustive cluster membership.
ineokm( x, centers, alpha = 0.3, beta = 0.05, nstart = 10, trace = FALSE, iter.max = 20 )
ineokm( x, centers, alpha = 0.3, beta = 0.05, nstart = 10, trace = FALSE, iter.max = 20 )
x |
A 3D interval array representing the data to be clustered. |
centers |
Either the number of clusters to create or a set of pre-initialized cluster centers. If a number is provided, it specifies how many clusters to create. |
alpha |
A numeric value that controls the degree of overlap between clusters (default is 0.3). |
beta |
A numeric value that controls the non-exhaustiveness of clusters (default is 0.05). |
nstart |
The number of times to run the Neo-KM algorithm with different starting values in order to find the best solution (default is 10). |
trace |
Logical value indicating whether to show the progress of the algorithm (default is 'FALSE'). |
iter.max |
Maximum number of iterations allowed for the Neo-KM algorithm (default is 20). |
A list of clustering results, including: - 'cluster': A vector indicating the cluster assignment of each data point. - 'centers': The final cluster centers. - 'totss': Total sum of squares. - 'withinss': Within-cluster sum of squares by cluster. - 'tot.withinss': Total within-cluster sum of squares. - 'betweenss': Between-cluster sum of squares. - 'size': The number of points in each cluster. - 'iter': Number of iterations the algorithm executed.
ineokm(iaggregate(iris, col = 5), 3) ineokm(iaggregate(iris, col = 5), iaggregate(iris, col = 5), 1, 2)
ineokm(iaggregate(iris, col = 5), 3) ineokm(iaggregate(iris, col = 5), iaggregate(iris, col = 5), 1, 2)
Temperature by month and humidity in european city.
inter_city
inter_city
A interval structure with 68 rows and 13 variables divided in min and max with 17 class:
Class :
Emotions in music aggregate on BPM to interval multi label data.
inter_emotions
inter_emotions
A interval structure with 59 rows and 71 variables divided in min and max with 6 class:
...
...
...
...
Class :
https://mulan.sourceforge.net/datasets-mlc.html
Results of a chemical analysis of wines grown in the same region in Italy but derived from three different cultivars, aggregate on sulfur dioxide to interval simple label data.
inter_wine
inter_wine
A interval structure with 132 rows and 10 variables divided in min and max with 7 class:
Class :
https://archive.ics.uci.edu/dataset/186/wine+quality
Clusters interval data using the OKM (Overlapping K-means) algorithm.
iokm( x, centers, nstart = 10, distance = "euclid", algorithm = "std", update = "mean", trace = FALSE, iter.max = 20, secure = FALSE )
iokm( x, centers, nstart = 10, distance = "euclid", algorithm = "std", update = "mean", trace = FALSE, iter.max = 20, secure = FALSE )
x |
A 3D interval array representing the data to be clustered. |
centers |
Either the number of clusters to create or a set of pre-initialized cluster centers. If a number is provided, it indicates how many clusters to create. |
nstart |
The number of times to run the OKM algorithm with different starting values to find the best result (default is 10). |
distance |
A string specifying the distance metric to use: 'euclid' for Euclidean distance or 'hausdorff' for Hausdorff distance (default is 'euclid'). |
algorithm |
A string specifying the algorithm type to use: 'std' for the standard algorithm or 'matrix' for matrix-based algorithm (default is 'std'). |
update |
A string specifying the update method for cluster centers. Either: 'mean', 'sum', 'join' or 'meet' (default is 'mean'). |
trace |
Logical value indicating whether to show progress of the algorithm (default is 'FALSE'). |
iter.max |
Maximum number of iterations allowed for the OKM algorithm (default is 20). |
secure |
Logical value indicating whether to ensure that the minimum is less than or equal to the maximum in intervals (default is 'FALSE'). |
A list of clustering results, including: - 'cluster': Matrix indicating the cluster assignment for each data point. - 'centers': The final cluster centers. - 'totss': Total sum of squares. - 'withinss': Within-cluster sum of squares by elements. - 'tot.withinss': Total within-cluster sum of squares. - 'betweenss': Between-cluster sum of squares. - 'size': The number of points in each cluster. - 'iter': The number of iterations the algorithm executed. - 'overlaps': The average overlap across clusters.
iokm(iaggregate(iris, col = 5), 2) iokm(iaggregate(iris, col = 5), iaggregate(iris, col = 5))
iokm(iaggregate(iris, col = 5), 2) iokm(iaggregate(iris, col = 5), iaggregate(iris, col = 5))
Determines if an object is a strictly valid interval object.
is.interval(x)
is.interval(x)
x |
An R object to be tested. |
A logical value indicating whether the object is a valid interval.
is.interval(inter_city) is.interval(1:4)
is.interval(inter_city) is.interval(1:4)
Plots the overlap of membership degrees in a matrix as a function of a threshold.
measure(x, min = 0, max = 1, step = 0.1)
measure(x, min = 0, max = 1, step = 0.1)
x |
A matrix of membership degrees. |
min |
Minimum threshold value for the plot (default is 0). |
max |
Maximum threshold value for the plot (default is 1). |
step |
Step size for the threshold values (default is 0.1). |
No return value, it plot the overlap as a function of the threshold.
membership_matrix <- matrix(runif(20), nrow = 5) measure(membership_matrix, min = 0, max = 1, step = 0.2)
membership_matrix <- matrix(runif(20), nrow = 5) measure(membership_matrix, min = 0, max = 1, step = 0.2)
Clusters data using the NEOKM (Non-Exhaustive Overlapping K-means) algorithm.
neokm( x, centers, alpha = 0.3, beta = 0.05, nstart = 10, trace = FALSE, iter.max = 20 )
neokm( x, centers, alpha = 0.3, beta = 0.05, nstart = 10, trace = FALSE, iter.max = 20 )
x |
A numeric matrix or data frame containing the data to be clustered. |
centers |
Either the number of clusters to create or a set of pre-initialized cluster centers. If a number is provided, it indicates how many clusters to create. |
alpha |
A numeric value representing the degree of overlap allowed between clusters (default is 0.3). |
beta |
A numeric value representing non-exhaustiveness, which affects the cluster formation (default is 0.05). |
nstart |
The number of times to run the NEOKM algorithm with different starting values to find the best result (default is 10). |
trace |
Logical value indicating whether to show progress of the algorithm (default is 'FALSE'). |
iter.max |
Maximum number of iterations allowed for the NEOKM algorithm (default is 20). |
A list of clustering results, including: - 'cluster': Matrix indicating the cluster assignment for each data point. - 'centers': The final cluster centers. - 'totss': Total sum of squares. - 'withinss': Within-cluster sum of squares by elements. - 'tot.withinss': Total within-cluster sum of squares. - 'betweenss': Between-cluster sum of squares. - 'size': The number of points in each cluster. - 'iter': The number of iterations the algorithm executed. - 'overlaps': The average overlap across clusters.
neokm(iris[, -5], 3) neokm(iris[, -5], iris[, -5], 1, 2)
neokm(iris[, -5], 3) neokm(iris[, -5], iris[, -5], 1, 2)
Clusters data using the OKM (Overlapping K-Means) clustering algorithm.
okm(x, centers, iter.max = 10, nstart = 1, trace = FALSE, method = "euclid")
okm(x, centers, iter.max = 10, nstart = 1, trace = FALSE, method = "euclid")
x |
A numeric data matrix or data frame containing the data to be clustered. |
centers |
Either a positive integer indicating the number of clusters to create or a matrix of pre-initialized cluster centers. |
iter.max |
Maximum number of iterations allowed for the clustering algorithm (default is 10). |
nstart |
Number of random initializations to find the best result (default is 1). |
trace |
Logical value indicating whether to display the progress of the algorithm (default is 'FALSE'). |
method |
A string specifying the distance metric to use; options are 'euclid' (Euclidean distance) or 'manhattan' (Manhattan distance) (default is "euclid"). |
A list containing the clustering results, including: - 'cluster': Matrix indicating the cluster assignments for each data point. - 'centers': The final cluster centers. - 'tot.withinss': Total within-cluster sum of squares. - 'overlaps': The measure of overlap among clusters.
okm(iris[, -5], 3)
okm(iris[, -5], 3)
Generates a visual representation of interval data as rectangles on a plot.
## S3 method for class 'interval' plot(x, ...)
## S3 method for class 'interval' plot(x, ...)
x |
An interval object to be plotted. |
... |
Additional graphical parameters such as 'col' and 'add'. |
No return value, it plot the interval.
plot(iaggregate(iris, 5)) plot(iaggregate(iris, 5), col = 4) plot(iaggregate(iris, 5), add = TRUE)
plot(iaggregate(iris, 5)) plot(iaggregate(iris, 5), col = 4) plot(iaggregate(iris, 5), add = TRUE)
Displays the results of fuzzy icmeans clustering in a readable format.
## S3 method for class 'icmeans' print(x, ...)
## S3 method for class 'icmeans' print(x, ...)
x |
An 'icmeans' object resulting from the 'fuzzy_icmeans' function. |
... |
Additional arguments passed to print(). |
No return value, it prints the clustering results to the console.
Displays the results of ikmeans clustering in a readable format.
## S3 method for class 'ikmeans' print(x, ...)
## S3 method for class 'ikmeans' print(x, ...)
x |
An 'ikmeans' object resulting from the 'ikmeans' function. |
... |
Additional arguments passed to print(). |
No return value, it prints the clustering results to the console.
Displays the results of Neo-KM clustering in a user-friendly format.
## S3 method for class 'ineokm' print(x, ...)
## S3 method for class 'ineokm' print(x, ...)
x |
An 'ineokm' object resulting from the 'ineokm' function. |
... |
Additional arguments passed to print(). |
No return value, it prints the clustering results to the console.
Custom print method for displaying interval objects in a readable format.
## S3 method for class 'interval' print(x, ...)
## S3 method for class 'interval' print(x, ...)
x |
An interval object to be printed. |
... |
Additional arguments passed to the underlying print() function. |
No return value, it prints the interval to the console.
print(inter_city)
print(inter_city)
Displays the results of IOKM clustering in a user-friendly format.
## S3 method for class 'iokm' print(x, ...)
## S3 method for class 'iokm' print(x, ...)
x |
An 'iokm' object resulting from the 'iokm' function. |
... |
Additional arguments passed to print(). |
No return value, it prints the clustering results to the console.
Displays the results of NEOKM clustering in a user-friendly format.
## S3 method for class 'neokm' print(x, ...)
## S3 method for class 'neokm' print(x, ...)
x |
A 'neokm' object resulting from the 'neokm' function. |
... |
Additional arguments passed to print(). |
No return value, it prints the clustering results to the console.
Displays the results of OKM clustering in a readable format.
## S3 method for class 'okm' print(x, ...)
## S3 method for class 'okm' print(x, ...)
x |
An OKM object resulting from the 'okm' function. |
... |
Additional arguments passed to print(). |
No return value, it prints the clustering results to the console.
Displays the results of R1-OKM clustering in a readable format.
## S3 method for class 'r1okm' print(x, ...)
## S3 method for class 'r1okm' print(x, ...)
x |
An R1-OKM object resulting from the 'r1okm' function. |
... |
Additional arguments passed to print(). |
No return value, it prints the clustering results to the console.
Displays the results of R2-OKM clustering in a readable format.
## S3 method for class 'r2okm' print(x, ...)
## S3 method for class 'r2okm' print(x, ...)
x |
An R2-OKM object resulting from the 'r2okm' function. |
... |
Additional arguments passed to print(). |
No return value, it prints the clustering results to the console.
Cluster data using the R1-OKM algorithm.
r1okm(x, centers, alpha = 0, nstart = 10, trace = FALSE, iter.max = 20)
r1okm(x, centers, alpha = 0, nstart = 10, trace = FALSE, iter.max = 20)
x |
A numeric data matrix or data frame containing the data to be clustered. |
centers |
Either a positive integer indicating the number of clusters to create or a matrix of initial cluster centers. |
alpha |
A numeric parameter controlling the clustering behavior, influencing the degree of overlap between clusters (default is 0). |
nstart |
Number of random initializations to find the best clustering result (default is 10). |
trace |
Logical value indicating whether to display progress information during execution (default is 'FALSE'). |
iter.max |
Maximum number of iterations allowed for the clustering algorithm (default is 20). |
A list containing the clustering results, including: - 'cluster': Matrix indicating the cluster assignments for each data point. - 'centers': The final cluster centers. - 'totss': Total sum of squares. - 'withinss': Within-cluster sum of squares for each cluster. - 'tot.withinss': Total within-cluster sum of squares. - 'betweenss': Between-cluster sum of squares. - 'size': Number of data points in each cluster. - 'iter': Number of iterations performed. - 'overlaps': Average number of clusters that each point overlaps with.
r1okm(iris[, -5], 3) r1okm(iris[, -5], 3, alpha = -0.5) r1okm(iris[, -5], iris[, -5], alpha = 1)
r1okm(iris[, -5], 3) r1okm(iris[, -5], 3, alpha = -0.5) r1okm(iris[, -5], iris[, -5], alpha = 1)
Cluster data using the R2-OKM algorithm.
r2okm(x, centers, lambda = 0, nstart = 10, trace = FALSE, iter.max = 20)
r2okm(x, centers, lambda = 0, nstart = 10, trace = FALSE, iter.max = 20)
x |
A numeric data matrix or data frame containing the data to be clustered. |
centers |
Either a positive integer specifying the number of clusters to create or a matrix of initial cluster centers. |
lambda |
A numeric parameter that controls the clustering behavior, influencing the shape and separation of clusters (default is 0). |
nstart |
Number of random initializations to find the best clustering result (default is 10). |
trace |
Logical value indicating whether to display progress information during execution (default is 'FALSE'). |
iter.max |
Maximum number of iterations allowed for the clustering algorithm (default is 20). |
A list containing the clustering results, which includes: - 'cluster': Matrix indicating the cluster assignments for each data point. - 'centers': The final cluster centers. - 'totss': Total sum of squares. - 'withinss': Within-cluster sum of squares for each cluster. - 'tot.withinss': Total within-cluster sum of squares. - 'betweenss': Between-cluster sum of squares. - 'size': Number of data points in each cluster. - 'iter': Number of iterations performed. - 'overlaps': Average number of clusters that each point overlaps with.
r2okm(iris[, -5], 3) r2okm(iris[, -5], 3, lambda = 0.3) r2okm(iris[, -5], iris[, -5], lambda = 1)
r2okm(iris[, -5], 3) r2okm(iris[, -5], 3, lambda = 0.3) r2okm(iris[, -5], iris[, -5], lambda = 1)
Reads a CSV file and converts the data into a 3D interval array.
read.interval(..., row.names = FALSE, class = NULL)
read.interval(..., row.names = FALSE, class = NULL)
... |
Additional arguments passed to read.csv(). |
row.names |
Logical indicating if the first column contains row names. |
class |
The column index of class labels (set to 'NULL' if not present). |
A structured interval object representing the data from the CSV file.
Writes an interval object to a CSV file.
write.interval(x, ..., class = FALSE)
write.interval(x, ..., class = FALSE)
x |
An interval object to be saved. |
... |
Additional arguments passed to write.csv(). |
class |
Logical indicating whether to add the class column in the CSV. |
No return value, it saves the interval to the given CSV file.