read.data {hclusteasy}R Documentation

Read Files in txt, xls, or xlsx Formats

Description

Read datasets files in txt(space-separated), xls or xlsx and return the data as a data.frame.

Usage

read.data(path, col.names = FALSE, col.types = NULL)

Arguments

path

Path to the txt(space-separated), xls or xlsx file.

col.names

Logical value indicating whether the first row of the dataset should be used as column names. Use TRUE to use the first row as column names or FALSE otherwise. Default is FALSE.

col.types

Character or a character vector specifying the data types for each column. Possible values are: "skip" , "guess" , "logical" , "numeric", "date" , "text" , or "list" . Default, it is NULL, which means the data types will be determined automatically ("guess"). Note that txt files do not support the col.types parameter.

Value

Dataset in data.frame format.

Examples

# Load the package
library(hclusteasy)

# Set the file path
file_path <- system.file("extdata",
                          "iris_uci.xlsx",
                           package = "hclusteasy")


# Read a .xlsx dataset
iris <- read.data(file_path,col.names = TRUE)


[Package hclusteasy version 0.1.0 Index]