Hi,
I have this simple df:
df <- data.frame(
stringsAsFactors = FALSE,
Market = c("00", "01", "02", "03", "77", "99", "SI", "TR", "UA"),
value = c(2219, 1091, 933, 910, 1100, 2286, 9165, 299, 504)
)
Market names containing letters are valid, containing numbers are invalid. I would like to either:
- Create a new variable (Vali.Markets) where correct names are flagged (for example as 1 therefore invalid as 0)
- Subset my df which would contain only valid records straight away without creating a filtering variable
Is this possible?