isNamespace(ns) isBaseNamespace(ns)
ns | a string or a namespace environment. |
# most environments are not namespace environments identical(isNamespace(globalenv()), FALSE) identical(isNamespace(baseenv()), FALSE) identical(isNamespace(new.env()), FALSE)# here is the namespace environment for the "base" package identical(isNamespace(getNamespace("base")), TRUE)
# check for base namespace environment isBaseNamespace(getNamespace("base")) # TRUE isBaseNamespace(getNamespace("stats")) # FALSE