Learn R Programming

akmedoids (version 1.3.0)

w_spaces: Whitespaces removal

Description

This function removes all the leading and the trailing whitespaces in data

Usage

w_spaces(traj, remove="Both", verbose=TRUE)

Arguments

traj

[matrix (numeric)]: longitudinal data. Each row represents an individual trajectory (of observations). The columns show the observations at consecutive time points.

remove

[character]: Type of whitespace to remove. That is, "Left" (leading), (2) "Right" (trailing), or "Both" (both leading and trailing whitespaces). Default: "Both".

verbose

to suppress output messages (to the console). Default: TRUE.

Value

A matrix with all whitespaces (if any) removed.

Details

Given a matrix suspected to contain whitespaces, this function removes the type of the whitespaces specified and returns a cleaned data. <U+2019>Whitespaces<U+2019> are white characters often introduced into data during data entry, for instance by wrongly pressing the spacebar. For example, neither " A" nor "A " is the same as "A" because of the whitespaces that exist in them. They can also result from systematic errors in data recording devices.

References

https://en.wikipedia.org/wiki/Whitespace_character

Examples

Run this code
# NOT RUN {
data(traj_w_spaces)

w_spaces(traj_w_spaces, remove="Both", verbose=TRUE)

# }

Run the code above in your browser using DataLab