knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)

foofactors

The goal of foofactors is to separate a string, but to prevent R from making it a list.

Installation

You can install the development version of foofactors from GitHub with:

# install.packages("devtools")
devtools::install_github("LaurineSeelt/foofactors")

Example

This is a basic example which shows you how to solve a common problem:

# install.packages("devtools")
devtools::install_github("LaurineSeelt/foofactors")
library(foofactors)
(x <- "alfa,bravo,charlie,delta")
str_split_one(x, pattern = ",")


This works better than the example below.

(x <- "alfa,bravo,charlie,delta")
strsplit(x, split = ",")
stringr::str_split(x, pattern = ",")


This returns a list of 1. Thus output is often inconvenient, so the foofactors function solves this.



LaurineSeelt/foofactors documentation built on May 17, 2022, 12:33 a.m.