R Tool Error: Problem with ‘mutate()’ input …

Hi! I am copying R code straight from R Studio into the R tool on Alteryx and running into the error: Problem with ‘mutate()’ input ‘mapping’. 

 

Here is the code within the R tool:

# Install Libraries
library(tidyverse)

# Read in data
prods <- read.Alteryx("#1", mode="data.frame")

# Clean
prods <- prods %>%
mutate(mapping = case_when(
grepl("Cheese", item_name) ~ "Cream Cheese",
grepl("Cheese Burger", item_name) ~ "Hamburger",
TRUE ~ mapping))

# Write out data
write.Alteryx(prods, 3)

 The data read in (in data frame ‘prods’) contains only 2 columns: item_name and mapping, each with type V_WString. 

 

Does anybody know why I would be running into this error? This code is error free when run in R Studio with the same data.

 

Thank you!

Read more here: Source link