EXCEL2R

Learning R for Excel Users

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

show values as difference from previous in R

Excel show values as difference from previous in R In this short tutorial learn how to emulate Excel show value as difference from previous in R. In Excel In R # pre-session options rm(list = ls()) # getwd() # setwd(“your preferred file folder”) df <- read.csv(“https://www.dropbox.com/s/uhp0ne0rdxk9k7r/stocks.csv?dl=1”) write.csv(df, “stocks.csv”) library(dplyr) library(tidyr) …

Posted on: December 5, 2017 Posted by: Guy Manova Comments: 0

Running totals (cumulative sums) in R

Running totals (cumulative sums) in R in this short tutorial, learn how to create Running totals (cumulative sums) in R using cumsum() in different scenerios including pivot table, just like you would use Excel’s pivot table “show values as” and selecting “running total” or “% running total” In Excel   …

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

Excel vlookup in R

Excel vlookup in R In this tutorial, we’ll see how to use table merge to mimic Excel vlookup in R. since Excel has an excellent table merge of it’s own in power query (or in the excel 2016 and beyond “get and transform” tab in the data ribbon) – i’ll …

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: November 4, 2017 Posted by: Guy Manova Comments: 0

Nested ifs in R

Excel nested ifs in R with the nested ifelse function In this short tutorial you can learn to replicate an Excel nested ifs functionality in R using nested ifelse statements or dplyr’s case_when function. If you want to look at a non nested simple ifelse, check out this post here: …

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

simple if statement in R with ifelse

Simple if statement in R with ifelse Let’s see how to create the equivalent of Excel’s simple if statement in R using the ifelse function in base R and with dplyr: In Excel:   In R: # pre-session options rm(list = ls()) #getwd() #setwd(“C:\\Users\\User\\Documents”)   if (!require(dplyr)) install.packages(‘dplyr’) library(dplyr) campaigns …

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 = …

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

Percent of total, pivot table “show values as” in R

mimicking “show value as” in R, as well as generally doing percent of total in R This is a short tutorial on how you can mimic Excel’s pivot table “show value as” functionality, as well as generally showing how to create a proportion table (prop table) to compute percent of …