[R] When to quote a package name

Muenchen, Robert A (Bob) muenchen at utk.edu
Mon Mar 10 19:40:27 CET 2008


Dear HelpeRs,

I'm confused about the role of quotes around package names on the
library and detach functions. Books on R use both approaches:

library(Hmisc)
describe(mydata)
detach(package:Hmisc)

and

library("Hmisc")
describe(mydata)
detach("package:Hmisc")

The help file for detach says "quoted or unquoted" and the help file for
library says about the package, "the name of a package, given as a name
or literal character string, or a character string, depending on whether
character.only is FALSE (default) or TRUE)."

Are there conditions under which it matters? Which is best?

Thanks,
Bob

=========================================================
Bob Muenchen (pronounced Min'-chen), 
Manager, Statistical Consulting Center 
U of TN Office of Information Technology
Stokely Management Center, Suite 200
916 Volunteer Blvd., Knoxville, TN 37996-0520
Voice: (865) 974-5230
FAX: (865) 974-4810
Email: muenchen at utk.edu
Web: http://oit.utk.edu/scc
Map: http://www.utk.edu/maps 
News: http://listserv.utk.edu/archives/statnews.html
=========================================================



More information about the R-help mailing list