
Last chance! 50% off unlimited learning
Sale ends in
These functions provide features required to implement a complete object browser in a GUI client.
obj_browse(
id = "default",
envir = .GlobalEnv,
all.names = NULL,
pattern = NULL,
group = NULL,
sep = "\t",
path = NULL,
regenerate = FALSE
)obj_clear(id = "default")
obj_dir()
obj_info(id = "default", envir = .GlobalEnv, object = "", path = NULL)
obj_list(
id = "default",
envir = .GlobalEnv,
object = NULL,
all.names = FALSE,
pattern = "",
group = "",
all.info = FALSE,
sep = "\t",
path = NULL,
compare = TRUE,
...
)
write.objList(x, path, sep = "\t", ...)
# S3 method for objList
print(
x,
sep = NA,
eol = "\n",
header = !attr(x, "all.info"),
raw.output = !is.na(sep),
...
)
obj_search(sep = "\t", path = NULL, compare = TRUE)
obj_menu(
id = "default",
envir = .GlobalEnv,
objects = "",
sep = "\t",
path = NULL
)
objBrowse(
id = "default",
envir = .GlobalEnv,
all.names = NULL,
pattern = NULL,
group = NULL,
sep = "\t",
path = NULL,
regenerate = FALSE
)
objClear(id = "default")
objDir()
objInfo(id = "default", envir = .GlobalEnv, object = "", path = NULL)
objList(
id = "default",
envir = .GlobalEnv,
object = NULL,
all.names = FALSE,
pattern = "",
group = "",
all.info = FALSE,
sep = "\t",
path = NULL,
compare = TRUE,
...
)
objSearch(sep = "\t", path = NULL, compare = TRUE)
objMenu(
id = "default",
envir = .GlobalEnv,
objects = "",
sep = "\t",
path = NULL
)
The id of the object browser (you can run several ones concurrently, providing you give them different ids).
An environment, or the name of the environment, or the position
in the search()
path.
Do we display all names (including hidden variables starting with '.')?
A pattern to match for selecting variables.
A group to filter.
Separator to use between items (if path is not NULL
).
The path where to write a temporary file with the requested information. Set to NULL (default) if you don't pass this data to your GUI client by mean of a file.
Do we force to regenerate the information?
Name of the object selected in the object browser, components/arguments of which should be listed.
Do we return all the information (envir as first column or not (by default).
If TRUE, result is compared with last cached value and the client is updated only if something changed.
Further arguments, passed to write.table()
.
Object returned by obj_list()
.
Separator to use between object entries, default is to list each item in a separate line.
If TRUE
, two-line header is printed, of the form:
Environment = environment name
Object = object name
Default is not to print header if all.info == TRUE
.
If TRUE
, a compact, better suited for parsing output is
produced.
A list with selected items in the object browser.
Depending on the function, a list, a string, a reference to an
external, temporary file or TRUE
in case of success or FALSE
otherwise
is returned invisibly.
obj_browse()
does the horse work. obj_dir()
gets the temporary
directory where exchange files with the GUI client are stored, in case you
exchange data through files. You can use a better way to communicate with
your GUI (you have to provide your code) and disable writing to files by
using path = NULL
.
obj_list()
lists objects in a given environment, elements of a recursive
object or function argument.
obj_search()
lists the search path.
obj_clear()
clears any reference to a given object browser.
obj_info()
computes a tooltip info for a given object.
obj_menu()` computes a context menu for selected object(s) in the object explorer managed by the GUI client.
print.objList()
print method for objList
objects.
# NOT RUN {
# Create various context menus
data(iris)
(obj_info(object = "iris"))
data(trees)
# For one object
(obj_menu(objects = "iris"))
# For multiple objects
(obj_menu(objects = c("iris", "trees")))
# For inexistant object (return "")
(obj_info(object = "noobject"))
(obj_menu(objects = "noobject"))
rm(iris, trees)
# For environments
(obj_info(envir = ".GlobalEnv"))
(obj_menu(envir = ".GlobalEnv"))
(obj_info(envir = "SciViews:TempEnv"))
(obj_menu(envir = "SciViews:TempEnv"))
(obj_info(envir = "package:datasets"))
(obj_menu(envir = "package:datasets"))
# For an environment that does not exist on the search path (return "")
(obj_info(envir = "noenvir"))
(obj_menu(envir = "noenvir"))
# }
Run the code above in your browser using DataLab