sub( "\\.[^.]*$", "", fname )
fwiw, i almost always use '[.]' in preference to '\\\\\\\\.', as it seems to be more likely to get through the various levels of quoting in different contexts.
3 messages · Greg Minshall, Jeff Newmiller, Kai Yang
sub( "\\.[^.]*$", "", fname )
fwiw, i almost always use '[.]' in preference to '\\\\\\\\.', as it seems to be more likely to get through the various levels of quoting in different contexts.
I trust the escapes to do what they are designed to do. Cat the pattern to the console if you don't.
sub( "\\.[^.]*$", "", fname )
fwiw, i almost always use '[.]' in preference to '\\\\\\\\.', as it seems to be more likely to get through the various levels of quoting in different contexts.
Sent from my phone. Please excuse my brevity.
Hello all, I have to learning R from beginning, since my group will get rid of SAS. So, my question may not be very clear for professional R user. I always dealing with column in data frame, not data vector.? Many thanks to Greg's example. it is very helpful. one more question, how can I know if the function is for column manipulations or for vector? Thank you, Kai
> sub( "\\.[^.]*$", "", fname ) fwiw, i almost always use '[.]' in preference to '\\\\\\\\.', as it seems to be more likely to get through the various levels of quoting in different contexts.