Hmm I can't seem to work it out. I am trying to just remove the periods and change the capitalization in a column (P1) and the data is BABACAR.THIOMBANE. So i want the resulting column to be Babacar Thiombane. Sorry I am new to R
str_to_title() is the very right function for capitalization
but we should take punctuation mark(.) into account.
For general usage, I also include another case
such as "BABACAR.THIOMBANE.AAA" and "BABACAR".
Method 1
split P1 by "."
apply str_to_title() function using sapply() function
Ok this is very helpful, thank you. For the sake of repeatability could you do it with P1 or something instead of listing the values in P1. The P1 column of the dataframe always comes out the same way [FIRSTNAME.LASTNAME] and want the process to be able to be repeated in different scripts.