Learn R Programming

surveydata (version 0.2.7)

strCommonUnique: Finds the common and unique elements in a character vector.

Description

Function takes a character string as input and find the common and unique elements. Assumes that the common element is at start of string.

Usage

strCommonUnique(string)

Value

list of common and unique strings

Arguments

string

Character vector

Examples

Run this code
test <- c("Q_1", "Q_2", "Q_3")
strCommonUnique(test)$common
strCommonUnique(test)$unique

Run the code above in your browser using DataLab