I want to create a new variable, created_idx_var, that is equal to 1 if the variable name contains any of the phrases "idx", "Idx", "indx", "Indx", "index", "Index", "etf", "ETF", or if the variable index equals "Yes".
I just started to learn R. My first step is to eliminate the dataset and keep only equity funds. Then I want to create a flag to see if a fund is an index fund. I searched online but couldn't find anything.
Some of the sample data: enter image description here
This is my code so far.
library(readxl)
mydata <- read_excel("C:/category.xlsx",sheet = 1)
utils::View(mydata)
mydata <- subset(mydata, global_group=="Equity")