Learn R Programming

clusterWebApp (version 0.1.3)

prepare_data: Prepare Built-in Datasets for Clustering

Description

Loads and preprocesses a built-in dataset for clustering analysis. Depending on the dataset name provided, different cleaning steps are applied.

Usage

prepare_data(dataset)

Value

A cleaned data.frame containing only numeric variables and no missing values.

Arguments

dataset

A string specifying the dataset name. Options are: "iris", "USArrests", "mtcars", "CO2", "swiss", "Moons".

Details

iris

The classic iris dataset, excluding the species column.

USArrests

State-wise arrest data. Missing values are removed.

mtcars

Motor trend car data set. No transformation applied.

CO2

CO2 uptake in grass plants. Only numeric columns are selected and rows with missing values are removed.

swiss

Swiss fertility and socio-economic indicators. Used as-is.

Moons

Synthetic non-linear dataset generated by mlbench::mlbench.smiley().

Examples

Run this code
data <- prepare_data("iris")
head(data)

Run the code above in your browser using DataLab