In R, I need to remove string that exceeds the length of 7 characters, from a column in a data frame. My code is,
memos.to <- as.data.frame(apply(memos.to,2,function(x)gsub('/^[a-zA-Z0-9]{7,}$/', NA ,x)))
and it doesn't seem to work. What's wrong here?