Category: Text Functions

Posted on: November 18, 2017 Posted by: Guy Manova Comments: 0

trimming white spaces, trimming unwanted text in R

Trim spaces and other unwanted text in R This tutorial illustrates how you can trim spaces and other unwanted text in R (compared to the trim function in Excel which works somewhat differently) In Excel # pre-session options rm(list = ls()) # getwd() # setwd(“C:/Users/your preferred path”) ####### a simple …

Posted on: November 11, 2017 Posted by: Guy Manova Comments: 0

Excel search and find functions in R

Excel search and find functions in R In this short tutorial we’ll see how to use the grepl function in base R and/or the stringr package to mimic Excel search and find functions in R. # pre-session options rm(list = ls()) #getwd() #setwd(“C:\\Users\\User\\Documents”) # load some packages if (!require(stringr)) install.packages(‘stringr’) …

Posted on: October 25, 2017 Posted by: Guy Manova Comments: 0

Excel text to columns in R

Excel text to columns in R This is short tutorial on how to mimic Excel text to columns functionality in R, in order to parse a character column to separate text strings   in Excel:   in R: # pre-session options rm(list = ls()) #getwd() #setwd(“C:\\Users\\User\\Documents”) install and load stringr …

Posted on: October 17, 2017 Posted by: Guy Manova Comments: 0

Excel left, right, mid functions in R

Mimic Excel left, right and mid text functions in R In this short tutorial, let’s see how to mimic substringing a character string like Excel left, right, mid functions in R.   # pre-session options rm(list = ls()) # getwd() # setwd(“C:/Users/your preferred path”)   df <- read.csv(url(“https://www.dropbox.com/s/bt2kaytzzsx6hle/dates.csv?dl=1”), skip = …