problem for strsplit function
sub( "\\.[^.]*$", "", fname )
On July 7, 2021 6:27:48 PM PDT, Kai Yang via R-help <r-help at r-project.org> wrote:
Hello List,
I have a? one column data frame to store file name with extension. I
want to create new column to keep file name only without extension.
I tried to use strsplit("name1.csv", "\\.")[[1]] to do that, but it
just retain the first row only and it is a vector.? how can do this for
all of rows and put it into a new column?
thank you,
Kai
[[alternative HTML version deleted]]
______________________________________________ R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Sent from my phone. Please excuse my brevity.