R/split_and_get.R

Defines functions splitAndGet

Documented in splitAndGet

#' splitAndGet
#' @title Split And Get
#' @description Split a string by space and get 
#' @author Jayachandra N
#' @param x string to split into words
#' @return List of worrds
#' @export
#' @examples
#' splitAndGet("R programming is awesome!")
splitAndGet <- function(x) {

  lapply(strsplit(x, " "), c) # Why c? strsplit will return a list

}

Try the shinyr package in your browser

Any scripts or data that you put into this service are public.

shinyr documentation built on Oct. 21, 2021, 5:07 p.m.