I have figured out how to create a new column on my data frame that = TRUE if the character string in "Column 5" is contained within the longer string in "Column 6" - can I do this by referring to the names of my columns rather than using [r,c] locational references?
rows = NULL
for(i in 1:length(excptn1[,1]))
{
rows[i] <- grepl(excptn1[i,5],excptn1[i,6], perl=TRUE)
}
As a programmer I'm nervous about referring to things as "Column 5 and Column 6"...I want to refer to the names of the variables captured in those columns so that I'm not reliant on my source file always having the columns in the identical order. Furthermore I might forget about that locational reference and add something earlier in the code that causes the locational reference to fail later...when you can think in terms of the names of the columns in general (rather than their particular ordering at a point in time) it's a lot easier to build robust production strength code.
I found a related question on this site and it uses the same kind of locational references I want to avoid...
While R does seem very flexible it seems to lack a lot of features that you'd want in scaleable, production strength code...but I'm hoping I'm wrong and can learn otherwise.
Thanks!