loading...

[Deprecated]

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 class '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
)

Arguments

id

The id of the object browser (you can run several ones concurrently, providing you give them different ids).

envir

An environment, or the name of the environment, or the position in the search() path.

all.names

Do we display all names (including hidden variables starting with '.')?

pattern

A pattern to match for selecting variables.

group

A group to filter.

sep

Separator to use between items (if path is not NULL).

path

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.

regenerate

Do we force to regenerate the information?

object

Name of the object selected in the object browser, components/arguments of which should be listed.

all.info

Do we return all the information (envir as first column or not (by default).

compare

If TRUE, result is compared with last cached value and the client is updated only if something changed.

...

Further arguments, passed to write.table().

x

Object returned by obj_list().

eol

Separator to use between object entries, default is to list each item in a separate line.

header

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.

raw.output

If TRUE, a compact, better suited for parsing output is produced.

objects

A list with selected items in the object browser.

Value

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.

Details

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.

Author

Philippe Grosjean phgrosjean@sciviews.org & Kamil Barton kamil.barton@uni-wuerzburg.de

Examples

# Create various context menus
data(iris)
(obj_info(object = "iris"))
#> Warning: `obj_info()` was deprecated in svMisc 1.5.0.
#> [1] "'data.frame':\t150 obs. of  5 variables:"                                                 
#> [2] " $ Sepal.Length: num  5.1 4.9 4.7 4.6 5 5.4 4.6 5 4.4 4.9 ..."                            
#> [3] " $ Sepal.Width : num  3.5 3 3.2 3.1 3.6 3.9 3.4 3.4 2.9 3.1 ..."                          
#> [4] " $ Petal.Length: num  1.4 1.4 1.3 1.5 1.4 1.7 1.4 1.5 1.4 1.5 ..."                        
#> [5] " $ Petal.Width : num  0.2 0.2 0.2 0.2 0.2 0.4 0.3 0.2 0.2 0.1 ..."                        
#> [6] " $ Species     : Factor w/ 3 levels \"setosa\",\"versicolor\",..: 1 1 1 1 1 1 1 1 1 1 ..."
#> [7] "Estimated size: 7.086 bytes kb"                                                           
data(trees)
# For one object
(obj_menu(objects = "iris"))
#> Warning: `obj_menu()` was deprecated in svMisc 1.5.0.
#>            widget                             value
#> help         item                              Help
#> example      item                           Example
#> sep           sep                                 -
#> Functions    menu                         Functions
#> print        item                    |Print or show
#> generic      item                        |summary()
#> generic.1    item                           |plot()
#> names        item                            |Names
#> str          item                              |Str
#> sep.1         sep                                |-
#> generic.2    item                            |$<-()
#> generic.3    item                     |$<--method()
#> generic.4    item                           |Math()
#> generic.5    item                            |Ops()
#> generic.6    item |Ops,nonStructure,vector-method()
#> generic.7    item    |Ops,structure,vector-method()
#> generic.8    item |Ops,vector,nonStructure-method()
#> generic.9    item    |Ops,vector,structure-method()
#> generic.10   item                        |Summary()
#> generic.11   item                              |[()
#> generic.12   item                            |[<-()
#> generic.13   item                     |[<--method()
#> generic.14   item                             |[[()
#> generic.15   item                           |[[<-()
#> generic.16   item                    |[[<--method()
#> generic.17   item                      |aggregate()
#> generic.18   item                  |anyDuplicated()
#> generic.19   item                          |anyNA()
#> generic.20   item                  |as.data.frame()
#> generic.21   item                        |as.list()
#> generic.22   item                      |as.matrix()
#> generic.23   item                      |as.vector()
#> generic.24   item                             |by()
#> generic.25   item                          |cbind()
#> generic.26   item         |coerce,ANY,list-method()
#> generic.27   item      |coerce,oldClass,S3-method()
#> generic.28   item                            |dim()
#> generic.29   item                       |dimnames()
#> generic.30   item                     |dimnames<-()
#> generic.31   item                     |droplevels()
#> generic.32   item                     |duplicated()
#> generic.33   item                           |edit()
#> generic.34   item                         |format()
#> generic.35   item                        |formula()
#> generic.36   item                           |head()
#> generic.37   item     |initialize,oldClass-method()
#> generic.38   item                          |is.na()
#> generic.39   item                          |merge()
#> generic.40   item                     |na.exclude()
#> generic.41   item                        |na.omit()
#> generic.42   item                         |prompt()
#> generic.43   item                          |rbind()
#> generic.44   item                      |row.names()
#> generic.45   item                    |row.names<-()
#> generic.46   item                         |rowsum()
#> generic.47   item           |show,oldClass-method()
#> generic.48   item                    |slotsFromS3()
#> generic.49   item             |slotsFromS3-method()
#> generic.50   item                        |sort_by()
#> generic.51   item                          |split()
#> generic.52   item                        |split<-()
#> generic.53   item                          |stack()
#> generic.54   item                            |str()
#> generic.55   item                         |subset()
#> generic.56   item                              |t()
#> generic.57   item                           |tail()
#> generic.58   item                      |transform()
#> generic.59   item                   |type.convert()
#> generic.60   item                         |unique()
#> generic.61   item                        |unstack()
#> generic.62   item                         |within()
#> generic.63   item                          |xtfrm()
#> View         menu                              View
#> viewDef      item                   |View (default)
#> require      item                  |Require svViews
#> report       item                         Report...
#> edit         item                              Edit
#> save         item                        Save as...
#> Copy         menu                              Copy
#> copyDef      item                   |Copy (default)
#> require.1    item                     |Require svIO
#> export       item                         Export...
#> sep.2         sep                                 -
#> remove       item                            Remove
#>                                                                    tip
#> help                                                 Help on an object
#> example                                   Run examples for this object
#> sep                                                                   
#> Functions                                Generic functions and methods
#> print                          Print or show the content of the object
#> generic                           Apply method summary() to the object
#> generic.1                            Apply method plot() to the object
#> names                       Names of variables contained in the object
#> str                          Compact str() representation of an object
#> sep.1                                                                 
#> generic.2                             Apply method $<-() to the object
#> generic.3                      Apply method $<--method() to the object
#> generic.4                            Apply method Math() to the object
#> generic.5                             Apply method Ops() to the object
#> generic.6  Apply method Ops,nonStructure,vector-method() to the object
#> generic.7     Apply method Ops,structure,vector-method() to the object
#> generic.8  Apply method Ops,vector,nonStructure-method() to the object
#> generic.9     Apply method Ops,vector,structure-method() to the object
#> generic.10                        Apply method Summary() to the object
#> generic.11                              Apply method [() to the object
#> generic.12                            Apply method [<-() to the object
#> generic.13                     Apply method [<--method() to the object
#> generic.14                             Apply method [[() to the object
#> generic.15                           Apply method [[<-() to the object
#> generic.16                    Apply method [[<--method() to the object
#> generic.17                      Apply method aggregate() to the object
#> generic.18                  Apply method anyDuplicated() to the object
#> generic.19                          Apply method anyNA() to the object
#> generic.20                  Apply method as.data.frame() to the object
#> generic.21                        Apply method as.list() to the object
#> generic.22                      Apply method as.matrix() to the object
#> generic.23                      Apply method as.vector() to the object
#> generic.24                             Apply method by() to the object
#> generic.25                          Apply method cbind() to the object
#> generic.26         Apply method coerce,ANY,list-method() to the object
#> generic.27      Apply method coerce,oldClass,S3-method() to the object
#> generic.28                            Apply method dim() to the object
#> generic.29                       Apply method dimnames() to the object
#> generic.30                     Apply method dimnames<-() to the object
#> generic.31                     Apply method droplevels() to the object
#> generic.32                     Apply method duplicated() to the object
#> generic.33                           Apply method edit() to the object
#> generic.34                         Apply method format() to the object
#> generic.35                        Apply method formula() to the object
#> generic.36                           Apply method head() to the object
#> generic.37     Apply method initialize,oldClass-method() to the object
#> generic.38                          Apply method is.na() to the object
#> generic.39                          Apply method merge() to the object
#> generic.40                     Apply method na.exclude() to the object
#> generic.41                        Apply method na.omit() to the object
#> generic.42                         Apply method prompt() to the object
#> generic.43                          Apply method rbind() to the object
#> generic.44                      Apply method row.names() to the object
#> generic.45                    Apply method row.names<-() to the object
#> generic.46                         Apply method rowsum() to the object
#> generic.47           Apply method show,oldClass-method() to the object
#> generic.48                    Apply method slotsFromS3() to the object
#> generic.49             Apply method slotsFromS3-method() to the object
#> generic.50                        Apply method sort_by() to the object
#> generic.51                          Apply method split() to the object
#> generic.52                        Apply method split<-() to the object
#> generic.53                          Apply method stack() to the object
#> generic.54                            Apply method str() to the object
#> generic.55                         Apply method subset() to the object
#> generic.56                              Apply method t() to the object
#> generic.57                           Apply method tail() to the object
#> generic.58                      Apply method transform() to the object
#> generic.59                   Apply method type.convert() to the object
#> generic.60                         Apply method unique() to the object
#> generic.61                        Apply method unstack() to the object
#> generic.62                         Apply method within() to the object
#> generic.63                          Apply method xtfrm() to the object
#> View                                                   View the object
#> viewDef                                   Default view for this object
#> require                                    Require the package svViews
#> report                                Prepare a report for this object
#> edit                                                    Edit an object
#> save                                                    Save to a file
#> Copy                                  Copy the object to the clipboard
#> copyDef             Copy this object to the clipboard (default format)
#> require.1                                     Require the package svIO
#> export                                           Export data to a file
#> sep.2                                                                 
#> remove        Remove (permanently!) one or several objects from memory
#>                                            code icon checked disabled hidden
#> help                                 help(iris)        FALSE    FALSE  FALSE
#> example                           example(iris)        FALSE    FALSE  FALSE
#> sep                                                    FALSE    FALSE  FALSE
#> Functions                                              FALSE    FALSE  FALSE
#> print                                      iris        FALSE    FALSE  FALSE
#> generic                           summary(iris)        FALSE    FALSE  FALSE
#> generic.1                            plot(iris)        FALSE    FALSE  FALSE
#> names                               names(iris)        FALSE    FALSE  FALSE
#> str                                   str(iris)        FALSE    FALSE  FALSE
#> sep.1                                                  FALSE    FALSE  FALSE
#> generic.2                             $<-(iris)        FALSE    FALSE  FALSE
#> generic.3                      $<--method(iris)        FALSE    FALSE  FALSE
#> generic.4                            Math(iris)        FALSE    FALSE  FALSE
#> generic.5                             Ops(iris)        FALSE    FALSE  FALSE
#> generic.6  Ops,nonStructure,vector-method(iris)        FALSE    FALSE  FALSE
#> generic.7     Ops,structure,vector-method(iris)        FALSE    FALSE  FALSE
#> generic.8  Ops,vector,nonStructure-method(iris)        FALSE    FALSE  FALSE
#> generic.9     Ops,vector,structure-method(iris)        FALSE    FALSE  FALSE
#> generic.10                        Summary(iris)        FALSE    FALSE  FALSE
#> generic.11                              [(iris)        FALSE    FALSE  FALSE
#> generic.12                            [<-(iris)        FALSE    FALSE  FALSE
#> generic.13                     [<--method(iris)        FALSE    FALSE  FALSE
#> generic.14                             [[(iris)        FALSE    FALSE  FALSE
#> generic.15                           [[<-(iris)        FALSE    FALSE  FALSE
#> generic.16                    [[<--method(iris)        FALSE    FALSE  FALSE
#> generic.17                      aggregate(iris)        FALSE    FALSE  FALSE
#> generic.18                  anyDuplicated(iris)        FALSE    FALSE  FALSE
#> generic.19                          anyNA(iris)        FALSE    FALSE  FALSE
#> generic.20                  as.data.frame(iris)        FALSE    FALSE  FALSE
#> generic.21                        as.list(iris)        FALSE    FALSE  FALSE
#> generic.22                      as.matrix(iris)        FALSE    FALSE  FALSE
#> generic.23                      as.vector(iris)        FALSE    FALSE  FALSE
#> generic.24                             by(iris)        FALSE    FALSE  FALSE
#> generic.25                          cbind(iris)        FALSE    FALSE  FALSE
#> generic.26         coerce,ANY,list-method(iris)        FALSE    FALSE  FALSE
#> generic.27      coerce,oldClass,S3-method(iris)        FALSE    FALSE  FALSE
#> generic.28                            dim(iris)        FALSE    FALSE  FALSE
#> generic.29                       dimnames(iris)        FALSE    FALSE  FALSE
#> generic.30                     dimnames<-(iris)        FALSE    FALSE  FALSE
#> generic.31                     droplevels(iris)        FALSE    FALSE  FALSE
#> generic.32                     duplicated(iris)        FALSE    FALSE  FALSE
#> generic.33                           edit(iris)        FALSE    FALSE  FALSE
#> generic.34                         format(iris)        FALSE    FALSE  FALSE
#> generic.35                        formula(iris)        FALSE    FALSE  FALSE
#> generic.36                           head(iris)        FALSE    FALSE  FALSE
#> generic.37     initialize,oldClass-method(iris)        FALSE    FALSE  FALSE
#> generic.38                          is.na(iris)        FALSE    FALSE  FALSE
#> generic.39                          merge(iris)        FALSE    FALSE  FALSE
#> generic.40                     na.exclude(iris)        FALSE    FALSE  FALSE
#> generic.41                        na.omit(iris)        FALSE    FALSE  FALSE
#> generic.42                         prompt(iris)        FALSE    FALSE  FALSE
#> generic.43                          rbind(iris)        FALSE    FALSE  FALSE
#> generic.44                      row.names(iris)        FALSE    FALSE  FALSE
#> generic.45                    row.names<-(iris)        FALSE    FALSE  FALSE
#> generic.46                         rowsum(iris)        FALSE    FALSE  FALSE
#> generic.47           show,oldClass-method(iris)        FALSE    FALSE  FALSE
#> generic.48                    slotsFromS3(iris)        FALSE    FALSE  FALSE
#> generic.49             slotsFromS3-method(iris)        FALSE    FALSE  FALSE
#> generic.50                        sort_by(iris)        FALSE    FALSE  FALSE
#> generic.51                          split(iris)        FALSE    FALSE  FALSE
#> generic.52                        split<-(iris)        FALSE    FALSE  FALSE
#> generic.53                          stack(iris)        FALSE    FALSE  FALSE
#> generic.54                            str(iris)        FALSE    FALSE  FALSE
#> generic.55                         subset(iris)        FALSE    FALSE  FALSE
#> generic.56                              t(iris)        FALSE    FALSE  FALSE
#> generic.57                           tail(iris)        FALSE    FALSE  FALSE
#> generic.58                      transform(iris)        FALSE    FALSE  FALSE
#> generic.59                   type.convert(iris)        FALSE    FALSE  FALSE
#> generic.60                         unique(iris)        FALSE    FALSE  FALSE
#> generic.61                        unstack(iris)        FALSE    FALSE  FALSE
#> generic.62                         within(iris)        FALSE    FALSE  FALSE
#> generic.63                          xtfrm(iris)        FALSE    FALSE  FALSE
#> View                                                   FALSE    FALSE  FALSE
#> viewDef                              view(iris)        FALSE     TRUE  FALSE
#> require                        require(svViews)        FALSE    FALSE  FALSE
#> report                          guiReport(iris)        FALSE     TRUE  FALSE
#> edit                         iris <- edit(iris)        FALSE    FALSE  FALSE
#> save                              guiSave(iris)        FALSE    FALSE  FALSE
#> Copy                                                   FALSE    FALSE  FALSE
#> copyDef                              copy(iris)        FALSE     TRUE  FALSE
#> require.1                         require(svIO)        FALSE    FALSE  FALSE
#> export                          guiExport(iris)        FALSE     TRUE  FALSE
#> sep.2                                                  FALSE    FALSE  FALSE
#> remove                                 rm(iris)        FALSE    FALSE  FALSE
#>            options
#> help              
#> example           
#> sep               
#> Functions         
#> print             
#> generic           
#> generic.1         
#> names             
#> str               
#> sep.1             
#> generic.2         
#> generic.3         
#> generic.4         
#> generic.5         
#> generic.6         
#> generic.7         
#> generic.8         
#> generic.9         
#> generic.10        
#> generic.11        
#> generic.12        
#> generic.13        
#> generic.14        
#> generic.15        
#> generic.16        
#> generic.17        
#> generic.18        
#> generic.19        
#> generic.20        
#> generic.21        
#> generic.22        
#> generic.23        
#> generic.24        
#> generic.25        
#> generic.26        
#> generic.27        
#> generic.28        
#> generic.29        
#> generic.30        
#> generic.31        
#> generic.32        
#> generic.33        
#> generic.34        
#> generic.35        
#> generic.36        
#> generic.37        
#> generic.38        
#> generic.39        
#> generic.40        
#> generic.41        
#> generic.42        
#> generic.43        
#> generic.44        
#> generic.45        
#> generic.46        
#> generic.47        
#> generic.48        
#> generic.49        
#> generic.50        
#> generic.51        
#> generic.52        
#> generic.53        
#> generic.54        
#> generic.55        
#> generic.56        
#> generic.57        
#> generic.58        
#> generic.59        
#> generic.60        
#> generic.61        
#> generic.62        
#> generic.63        
#> View              
#> viewDef           
#> require           
#> report            
#> edit              
#> save              
#> Copy              
#> copyDef           
#> require.1         
#> export            
#> sep.2             
#> remove            
# For multiple objects
(obj_menu(objects = c("iris", "trees")))
#>        widget      value
#> save     item Save as...
#> remove   item     Remove
#>                                                             tip
#> save                                             Save to a file
#> remove Remove (permanently!) one or several objects from memory
#>                        code icon checked disabled hidden options
#> save   guiSave(iris, trees)        FALSE    FALSE  FALSE        
#> remove      rm(iris, trees)        FALSE    FALSE  FALSE        
# For inexistant object (return "")
(obj_info(object = "noobject"))
#> [1] ""
(obj_menu(objects = "noobject"))
#> [1] widget   value    tip      code     icon     checked  disabled hidden  
#> [9] options 
#> <0 rows> (or 0-length row.names)
rm(iris, trees)
#> Warning: object 'iris' not found
#> Warning: object 'trees' not found

# For environments
(obj_info(envir = ".GlobalEnv"))
#> [1] "Global environment\n\n          used (Mb) gc trigger  (Mb) max used  (Mb)\nNcells 1301063 69.5    2479240 132.5  2479240 132.5\nVcells 8114216 62.0   14141333 107.9 11710031  89.4"
(obj_menu(envir = ".GlobalEnv"))
#>        widget     value                                              tip
#> load     item   Load...                                   Load R objects
#> source   item Source...                                    Source R code
#> import   item Import...                                 Import data in R
#> sep       sep         -                                                 
#> detach   item    Detach Detach an object or package from the search path
#>                                 code icon checked disabled hidden options
#> load     guiLoad(pos = ".GlobalEnv")        FALSE    FALSE  FALSE        
#> source guiSource(pos = ".GlobalEnv")        FALSE    FALSE  FALSE        
#> import                   guiImport()        FALSE    FALSE  FALSE        
#> sep                                         FALSE    FALSE  FALSE        
#> detach            detach(.GlobalEnv)        FALSE     TRUE  FALSE        
(obj_info(envir = "SciViews:TempEnv"))
#> [1] "SciViews temporary variables environment"
(obj_menu(envir = "SciViews:TempEnv"))
#>        widget  value                                              tip
#> detach   item Detach Detach an object or package from the search path
#>                            code icon checked disabled hidden options
#> detach detach(SciViews:TempEnv)        FALSE     TRUE  FALSE        
(obj_info(envir = "package:datasets"))
#> [1] "Package:       datasets\nVersion:       4.5.1\nPriority:      base\nTitle:         The R Datasets Package\nAuthor:        R Core Team and contributors worldwide\nMaintainer:    R Core Team <do-use-Contact-address@r-project.org>\nContact:       R-help mailing list <r-help@r-project.org>\nDescription:   Base R datasets.\nLicense:       Part of R 4.5.1\nBuilt:         R 4.5.1; ; 2025-06-13 21:13:29 UTC; unix"
(obj_menu(envir = "package:datasets"))
#>              widget             value
#> pkgInfo        item      Package info
#> sep             sep                 -
#> detach         item            Detach
#> detachUnload   item Detach and unload
#>                                                              tip
#> pkgInfo               Show detailed information for this package
#> sep                                                             
#> detach          Detach an object or package from the search path
#> detachUnload Detach a package from the search path and unload it
#>                                         code icon checked disabled hidden
#> pkgInfo      <<<H>>>library(help = datasets)        FALSE    FALSE  FALSE
#> sep                                                 FALSE    FALSE  FALSE
#> detach              detach(package:datasets)        FALSE     TRUE  FALSE
#> detachUnload                                        FALSE     TRUE  FALSE
#>              options
#> pkgInfo             
#> sep                 
#> detach              
#> detachUnload        
# For an environment that does not exist on the search path (return "")
(obj_info(envir = "noenvir"))
#> [1] ""
(obj_menu(envir = "noenvir"))
#> [1] widget   value    tip      code     icon     checked  disabled hidden  
#> [9] options 
#> <0 rows> (or 0-length row.names)