Learn R Programming

iNZightMR (version 2.3.0)

substrsplit: Extract Common Name from variables

Description

Help mro variables extract common name out

Usage

substrsplit(obj, split_string = "")

Value

A list with common character and unique variable name respectively

Arguments

obj

It can be a vector or data frame, however, substrsplit is usually used in the iNZightMR function.

split_string

Specification of a string to allow splits on (e.g., use " " to only allow splitting at words).

Examples

Run this code
substrsplit(c("varx", "vary", "varz"))

strings <- c("Do you like eating eggs?", "Do you like elephants?" , "Do you like elections?")
substrsplit(strings)
substrsplit(strings, split_string = " ")

Run the code above in your browser using DataLab