Extension for 'R6' Base Class

Useful methods and data fields to extend the bare bones 'R6' class provided by the 'R6' package - ls-method, hashes, warning- and message-method, general get-method and a debug-method that assigns self and private to the global environment.




Status

Travis-CI BuildStatus codecov CRANversion



Version

0.1.2
2018-01-14



Description

Useful methods and data fields to extend the bare bones ‘R6’ class provided by the ‘R6’ package - ls-method, hashes, warning- and message-method, general get-method and a debug-method that assigns self and private to the global environment.



License

MIT + file LICENSE
Peter Meissner [aut, cre]



Citation

To cite package ‘r6extended’ in publications use:

Peter Meissner (2019). r6extended: Extension for ‘R6’ Base Class. R package version 0.1.2. https://github.com/petermeissner/r6extended

A BibTeX entry for LaTeX users is

@Manual{, title = {r6extended: Extension for ‘R6’ Base Class}, author = {Peter Meissner}, year = {2019}, note = {R package version 0.1.2}, url = {https://github.com/petermeissner/r6extended}, }



BibTex for citing

@Manual{, title = {r6extended: Extension for ‘R6’ Base Class}, author = {Peter Meissner}, year = {2019}, note = {R package version 0.1.2}, url = {https://github.com/petermeissner/r6extended}, }



Installation

stable version from CRAN

install.packages("r6extended")
devtools::install_github("petermeissner/r6extended")



Example Usage



… starting up …

library(r6extended)

new instance

ext <- r6extended$new()

whats there?

ext$ls()
##        name   where    class
## 1      hash private function
## 2    hashed private function
## 3    hashes private     list
## 4     clone    self function
## 5     debug    self function
## 6       get    self function
## 7   hash_do    self function
## 8  hash_get    self function
## 9        ls    self function
## 10  message    self function
## 12  warning    self function
## 11  options    self     list

getting things (wherever they are, also private stuff)

ext$get("options")
## $verbose
## [1] TRUE
## 
## $warning
## [1] TRUE
ext$get("hashes")
## list()

messages

ext$message("Please note ...")
## r6extended : Please note ...
ext$options$verbose <- FALSE
ext$message("Please note ...")

build in hashing

ext$hash_do()
ext$hash_get("options")
## [1] "feb524178c59d96d"

debugging

ext$debug()
 
private$hash()
## $hash
## [1] "a2145d8a65aed2fd"
## 
## $hashed
## [1] "6ddac4b4cd8556db"
## 
## $hashes
## [1] "192f75af59696813"
## 
## $clone
## [1] "11f7a5b9d5763be9"
## 
## $debug
## [1] "3f1f72468b467261"
## 
## $get
## [1] "31fd6f69e480adaa"
## 
## $hash_do
## [1] "236b962b10c0eb01"
## 
## $hash_get
## [1] "bdc96d1de6eea991"
## 
## $ls
## [1] "d18ce6a302986879"
## 
## $message
## [1] "0eb0aed48eca3590"
## 
## $warning
## [1] "c30df76f92169fbd"
## 
## $options
## [1] "feb524178c59d96d"
self$ls()
##        name   where    class
## 1      hash private function
## 2    hashed private function
## 3    hashes private     list
## 4     clone    self function
## 5     debug    self function
## 6       get    self function
## 7   hash_do    self function
## 8  hash_get    self function
## 9        ls    self function
## 10  message    self function
## 12  warning    self function
## 11  options    self     list

News

NEWS r6extended

version 0.1.2 // 2019-02-11 ...

  • LICENCE file had no licence holder in it - :-0

version 0.1.1 // 2018-01-13 ...

  • first CRAN realease

version 0.1.0 // 2016-09-01 ...

  • BUGFIXES

  • FEATURE

    • rtext_extended
  • Development

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("r6extended")

0.1.2 by Peter Meissner, 2 months ago


https://github.com/petermeissner/r6extended


Report a bug at https://github.com/petermeissner/r6extended/issues


Browse source code at https://github.com/cran/r6extended


Authors: Peter Meissner [aut, cre]


Documentation:   PDF Manual  


MIT + file LICENSE license


Imports R6, magrittr, digest, hellno

Suggests testthat, knitr, rmarkdown, covr


Imported by crossword.r.


See at CRAN