split_double_col: Split Two-Field Column

Description Usage Arguments Value Examples

View source: R/sv.R

Description

Splits a column with 2 comma-separated fields into two columns.

Usage

1

Arguments

d

Input tibble data.

nms

A character vector of columns to split.

Value

A modified tibble with the original columns averaged and split nicely.

Examples

1
2
3
4
5
6
7
8
9
x <- tibble::tibble(
  a = letters[1:11],
  b = c("0.4,0.8", paste0(round(runif(10), 2), ",", round(runif(10), 2))),
  nacol = rep(NA, 11),
  namix = sample(c(NA, "0.4,0.6"), 11, replace = TRUE)
)
(b <- gpgr:::split_double_col(x, "b"))
(nacol <- gpgr:::split_double_col(x, "nacol"))
(namix <- gpgr:::split_double_col(x, "namix"))

umccr/gpgr documentation built on Nov. 25, 2021, 1:15 p.m.