I am trying to make a dummy variable for product without also grabbing compound words that include product. In the output above it counts "productdesign" as 1 in tags$product. I am trying to find the syntax to strictly grab "product".
library(NLP)
library(tm)
library(tidytext)
library(tidyverse)
library(topicmodels)
library(dplyr)
library(stringr)
library(purrr)
library(tidyr)
#sample dataset
tags <- c("product productdesign electronicdevice", "productdesign electronicdevice")
web <- c("hardware", "sunglasses")
tags <- data_frame(tags, web)
tags <- mutate(tags, product = ifelse(grepl("product", tags), 1, 0))