valid_pkgname {hgutils}R Documentation

Validate package and function names

Description

Naming rule obtained from 'Writing R Extensions' manual. The corresponding regular expression used for verifying the package name is "[[:alpha:]][[:alnum:]\.]*[[:alnum:]]". For function names this is "((?:[[:alpha:]]|\.(?![0-9]))[[:alnum:]_\.]*)"

Usage

valid_pkgname(pkg)

valid_funcname(func)

Arguments

pkg

string vector containing package names. Can be a vector of strings with size of at least 1.

func

string vector containing function names. Can be a vector of strings with size of at least 1.

Value

A named logical indicating whether the package name is valid.

References

make.names, 'Writing R Extensions' manual.

See Also

Other developer functions: crossref_description(), generic_implementations(), load_packages(), update_settings()

Examples

valid_pkgname("hgutils") # valid
valid_pkgname("ggplot2") # valid
valid_pkgname("pkg2.-1") # invalid

valid_funcname(".hgutils") # valid
valid_funcname("ggplot2") # valid
valid_funcname(".2pkg") # invalid

[Package hgutils version 0.2.11 Index]