How do you replace a part of a string in R?
a) replace()
b) gsub()
c) str_replace()
d) substitute()
Answer:
b) gsub()
Explanation:
The gsub()
function is used to replace all occurrences of a pattern in a string in R.
The gsub()
function is used to replace all occurrences of a pattern in a string in R.