Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

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.

Details

Given a matrix suspected to contain whitespaces, this function removes the type of the whitespaces specified and returns a cleaned data. ’Whitespaces’ 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.

Value

A matrix with all whitespaces (if any) removed.

References

Examples

data(traj_w_spaces)

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

akmedoids

Anchored Kmedoids for Longitudinal Data Clustering

v1.3.0
GPL-3
Authors
Monsuru Adepeju [cre, aut], Samuel Langton [aut], Jon Bannister [aut]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.