Merge branch 'isspace' into dev
This commit is contained in:
commit
d152ce624d
2 changed files with 34 additions and 0 deletions
11
R/isspace.R
Normal file
11
R/isspace.R
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
#' @title Determine space characters
|
||||
#' @description Determine which characters are space characters
|
||||
#' @param A a character array or a string scalar
|
||||
#' @return a vector TF such that the elements of TF are logical 1 (true) where corresponding characters in A are space characters, and logical 0 (false) elsewhere
|
||||
#' @note Recognized whitespace characters are ` ` and `\\t`.
|
||||
#' @author Waldir Leoncio
|
||||
isspace <- function(A) {
|
||||
A_split <- unlist(strsplit(A, ''))
|
||||
TF <- A_split %in% c(' ', '\t')
|
||||
return(as.numeric(TF))
|
||||
}
|
||||
23
man/isspace.Rd
Normal file
23
man/isspace.Rd
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
% Generated by roxygen2: do not edit by hand
|
||||
% Please edit documentation in R/isspace.R
|
||||
\name{isspace}
|
||||
\alias{isspace}
|
||||
\title{Determine space characters}
|
||||
\usage{
|
||||
isspace(A)
|
||||
}
|
||||
\arguments{
|
||||
\item{A}{a character array or a string scalar}
|
||||
}
|
||||
\value{
|
||||
a vector TF such that the elements of TF are logical 1 (true) where corresponding characters in A are space characters, and logical 0 (false) elsewhere
|
||||
}
|
||||
\description{
|
||||
Determine which characters are space characters
|
||||
}
|
||||
\note{
|
||||
Recognized whitespace characters are ` ` and `\\t`.
|
||||
}
|
||||
\author{
|
||||
Waldir Leoncio
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue