SyntaxFix
Write A Post
Hire A Developer
Questions
You need to use [[, the programmatic equivalent of $. Otherwise, for example, when i is col1, R will look for df$i instead of df$col1.
[[
$
i
col1
df$i
df$col1
for(i in names(df)){ df[[paste(i, 'length', sep="_")]] <- str_length(df[[i]]) }