Re: [R] file.stem?

2013-07-15 Thread arun
Hi, May be this also works. basename(file_path_sans_ext("/the/path/to/afile.txt")) #[1] "afile" A.K. - Original Message - From: Rui Barradas To: Witold E Wolski Cc: r-help@r-project.org Sent: Monday, July 15, 2013 10:32 AM Subject: Re: [R] file.stem? Hello, You

Re: [R] file.stem?

2013-07-15 Thread Witold E Wolski
Rui, Thank you On 15 July 2013 16:32, Rui Barradas wrote: > Hello, > > You can use ?basename to write a file.stem function: > > > basename("/the/path/to/afile.txt") > > file.stem <- function(x){ > bn <- basename(x) > gsub("\\..*$", "", bn) > } > file.stem("/the/path/to/afile.txt")

Re: [R] file.stem?

2013-07-15 Thread Rui Barradas
Hello, You can use ?basename to write a file.stem function: basename("/the/path/to/afile.txt") file.stem <- function(x){ bn <- basename(x) gsub("\\..*$", "", bn) } file.stem("/the/path/to/afile.txt") Hope this helps, Rui Barradas Em 15-07-2013 15:23, Witold E Wolski escrev

Re: [R] file.stem?

2013-07-15 Thread Jeff Newmiller
Read the Posting Guide... use plain text email. help.search("file") --- Jeff NewmillerThe . . Go Live... DCN:Basics: ##.#. ##.#. Live Go...

[R] file.stem?

2013-07-15 Thread Witold E Wolski
Looking for a function which returns the stem of the filename given a path. i.e. > file.stem("/the/path/to/afile.txt") > afile regards -- Witold Eryk Wolski [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://sta