Try the dir() function. ?dir
# for example dir("c:/", pattern="foo.pdf", full.names=T, ignore.case=T, recursive=T) Jean Tyler Rinker wrote on 08/25/2011 11:54:28 AM: > > I am not a programmer and am self-taught so I may lack the > language to ask this appropriately (perhaps why an rseek search was > unfruitful). > > Let's say I saved a file to my desktop called foo.pdf. Then I want > R to return the file path of > foo.pdf (pretend I don't know the location(path) of foo.pdf). > > Question: How would I get R to return the unknown file path for > foo.pdf. > > I hypothesize that the find find.package() function code contains > the secret for doing this but am unable to parse out the snippet to do so. > > I attempted file.path("foo.pdf") > > which R returns [1] "foo.pdf" #not what I want > > =========================================== > > R version 2.14 beta > > Windows 7 > > Reproducible code is not appropriate for this query > > ______________________________________________ > R-help@r-project.org mailing list > 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. [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list 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.