Learn R Programming

moranajp (version 0.9.7)

text_id_with_break: Add ids.

Description

Add ids.

Usage

text_id_with_break(x, brk, end_with_brk = TRUE)

add_text_id_df(df, col, brk, end_with_brk = TRUE)

Value

id_with_break() returns id vector, add_id_df() returns dataframe.

Arguments

x

A string vector.

brk

A string to specify the break between ids.

end_with_brk

A logical. TRUE: brk means the end of groups. FALSE: brk means the beginning of groups.

df

A dataframe.

col

A string to specify the column.

Examples

Run this code
tmp <- c("a", "brk", "b", "brk", "c")
brk <- "brk"
text_id_with_break(tmp, brk)
add_text_id_df(tibble::tibble(tmp), col = "tmp", "brk")

Run the code above in your browser using DataLab