Skip to content
Prev 48659 / 63424 Next

Question on Code snippet semantics

I came across this code in library.R

package <- as.character(substitute(package))

where package is the first argument to the "library" function.

I've been racking my brains to understand why this is not just an 
elaborate (and ineffcient) way to write:

package <- "package"

E.g.

 > package <- as.character(substitute(package))
 > package
[1] "package"
 >

Thanks
Mick Jordan