Learn R Programming

do (version 2.0.0.1)

mid: Truncate Characters from the Inside

Description

Truncate Characters from the Inside

Usage

mid(x, start, n = 1e+11)

Value

substring

Arguments

x

can be number, strings, verctors, dataframe or matrix.

start

starting position

n

length, n can be less than zero

Examples

Run this code
mid("abcd",3,1)
mid(c("abc","gjh"),2,2)
df = data.frame(
  a = c(123,234,456),
  b = c("abc","bcd","hjg")
)
mid(df,2,1)
mid(df,2,-2)

Run the code above in your browser using DataLab