import_inops.control {tinycodet}R Documentation

import_inops.control

Description

Additional arguments to control exposing infix operators in the import_inops function.

Usage

import_inops.control(
  exclude = NULL,
  include.only = NULL,
  overwrite = TRUE,
  inherits = FALSE
)

Arguments

exclude

a character vector, giving the infix operators NOT to expose to the current environment.
This can be handy to prevent overwriting any (user defined) infix operators already present in the current environment.

include.only

a character vector, giving the infix operators to expose to the current environment, and the rest of the operators will not be exposed.
This can be handy to prevent overwriting any (user defined) infix operators already present in the current environment.

overwrite

logical, indicating if it is allowed to overwrite existing infix operators.

  • If TRUE (default), a warning is given when operators existing in the current environment are being overwritten, but the function continuous nonetheless.

  • If FALSE, an error is produced when the to be exposed operators already exist in the current environment, and the function is halted.

inherits

logical.
When exposing infix operators, import_inops checks if infix operators with the same names are already present in the current environment.
If inherits = FALSE, only the current environment is checked for existing operators.
If inherits = TRUE, enclosed environments, most notably package namespaces, are also checked for existing operators.
Defaults to FALSE.
See also exists.

Details

You cannot specify both the exclude and include.only arguments. Only one or the other, or neither.

Value

This function is used internally in the import_inops function.

See Also

import_inops(), tinycodet_import()

Examples


# additional arguments (only used when exposing, not unexposing):
import_as(~ stri., "stringi")
import_inops(expose = stri., include.only = "%s==%")
import_inops(unexpose = stri.)
import_inops(expose = "stringi", exclude = "%s==%")
import_inops(unexpose = "stringi")
import_inops(expose = stri., overwrite = FALSE)
import_inops(unexpose = stri.)
import_inops(expose = "stringi", overwrite = FALSE)
import_inops(unexpose = "stringi")



[Package tinycodet version 0.5.0 Index]