Hi,
I have this simple df containing string variables only:
source <- data.frame(
stringsAsFactors = FALSE,
URN = c("aaa","bbb","ccc",
"ddd","eee","fff","ggg","hhh"),
Name = c("xxx","xxx","yyy",
"yyy","yyy","zzzz","abcde","zzzz"),
A1 = c("None.",NA,
"No comments related to this exercise","Na",
"N/A","Interesting comment","abc", "whatever is fine"),
A2 = c("Nothing",
"I have nothing in common","NA",NA,
"Another comment","....?","xxxx", "All fine"),
B1 = c("Service","All good",
"aa"," I don't know",
"The final comment about that","Nothing.","na","Everything"),
B2 = c("aaa","Nothing ",
"None","My final comments are ok", "I don't know ",
"Nothing.","Another comment","really")
)
source
Can I merge only variables containing long phrases [let's say with nchar(.x) > 15)]?
If that is not possible, how can I merge all variables apart from URN and Name?