https://github.com/canmod/oor
Last synced: 5 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/canmod/oor
- Owner: canmod
- License: other
- Created: 2022-10-18T19:47:32.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2025-08-22T13:47:26.000Z (10 months ago)
- Last Synced: 2025-09-09T22:28:13.457Z (9 months ago)
- Language: R
- Size: 85 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Lightweight Tools for Object Oriented Programming
[](https://github.com/canmod/oor/actions/workflows/R-CMD-check.yaml)
## Why?
Many object oriented programming frameworks exist for R, so why another? I wanted minimal magic, to develop a very solid understanding and use of basic R concepts (e.g. environments), and to have no dependencies on third-party packages.
## Installation
To install the development version please use this.
```
remotes::install_github("canmod/oor")
```
To install the stable version please use this.
```
install.packages("oor", repos = "https://canmod.github.io/drat", type = "source")
```
## Roadmap
We intend for this to be a very stable and simple package. To get to this point, the roadmap consists of the following two items that we hope will never change.
1. Remove or simplify the complexities of traits and other fancy types of inheritance.
2. Test
## Hello world
```
Printer = function(x) {
self = Base()
self$.x = x
self$print = function() print(self$.x)
return_object(self, "Printer")
}
printer = Printer("something to print")
printer$print()
SupportivePrinter = function(x) {
self = Printer(x)
self$print = function() {
print(paste(sQuote(self$.x), "is a very nice thing to say"))
}
return_object(self, "Supportive")
}
supportive_printer = SupportivePrinter("something to print")
supportive_printer$print()
```