How can I replace .. with .
I tried something like:
names(dataset) <- gsub("[/./.]",".",names(dataset))
But it doesn't work as I hoped.
Try adding fixed = T
R> c <- "v.."
[1] "v.."
R> gsub("..", '.', c, fixed = T)
[1] "v."
I think you have your slashes in the wrong direction, and you need to double them:
gsub("\\.\\.",".",names(dataset))
Fixed to reflect comments.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With