one.drop: One Drop

Description Usage Arguments Value Examples

View source: R/ShortFunctions.R

Description

Drops all elements of a character vector that have fewer than 2 characters

Usage

1
one.drop(x, keep.na = F)

Arguments

x

a character vector

keep.na

logical vector of length 1 indicating whether to keep NA elements

Value

A vector containing the elements of x that are longer than 1 character

Examples

1
2
3
4
5
6
7
ex1 = LETTERS[1:10]
ex2 = paste0(c("A","B","C", "D"), c("","ABC","AB","A"))
ex3 = c(NA, NA, NA, "1 2 3", "6", "591", "A ")
one.drop(ex1)
one.drop(ex2)
one.drop(ex3)
one.drop(ex3, TRUE)

debarros/dbTools documentation built on Sept. 18, 2020, 10:51 a.m.