I want to rename some random columns of a large data frame and I want to use the current column names, not the indexes. Column indexes might change if I add
names(mydf)[names(mydf) == "MyName.1"] = "MyNewName" # 13 characters shorter.
Although, you may want to replace a vector eventually. In that case, use %in% instead of == and set MyName.1 as a vector of equal length to MyNewName
%in%
==