-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.Rmd
94 lines (72 loc) · 3.17 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
---
output: github_document
bibliography: [./inst/REFERENCES.bib]
biblio-style: apalike
link-citations: yes
nocite: |
@Gamma1995
@Fowler2002
@Ousterhout2018
editor_options:
canonical: true
markdown:
wrap: 80
references:
location: section
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
source(file.path(usethis::proj_get(), "vignettes", "_common.R"))
```
# `R6P` <img src="https://raw.githubusercontent.com/tidylab/R6P/master/pkgdown/logo.png" align="right" height="75"/>
<!-- badges: start -->
[![CRAN
status](https://www.r-pkg.org/badges/version/R6P)](https://CRAN.R-project.org/package=R6P)
[![R build
status](https://github.com/tidylab/R6P/workflows/R-CMD-check/badge.svg)](https://github.com/tidylab/R6P/actions)
[![codecov](https://codecov.io/gh/tidylab/R6P/branch/master/graph/badge.svg?token=U6FL5N32FL)](https://codecov.io/gh/tidylab/R6P)
<!-- badges: end -->
```{r, echo = FALSE, out.width = "100%"}
# knitr::include_graphics("https://i.imgur.com/q8GRJll.png")
```
## Intentions
- `R6P` is a collection of useful design patterns in R
- `R6P` explains *how a design pattern works* and *when to use a design
pattern*
- `R6P` provides examples that show how to implement each design pattern in R
```{r, error=TRUE}
stop("Most functions and classes provided by the `R6P` package are not useful by themselves. This is because design patterns are employed in a specific context. `R6P` implementations are designed for demonstration purposes. Instead of directly using the design pattern as they appear in the package, you'd have to adjust the source code (provided in the examples) to the problem you are trying to solve.")
```
## Introduction
`r read.dcf("DESCRIPTION", "Description")[[1]]`
This package is based on the work of Gamma1995, and Fowler2002.
### Should I use design patterns?
::: {.alert .alert-info}
Design patterns represent an alternative to design:
rather than designing a new mechanism from scratch, just apply a well-known
design pattern. For the most part, this is good: design patterns arose because
they solve common problems, and because they are generally agreed to provide
clean solutions. If a design pattern works well in a particular situation, it
will probably be hard for you to come up with a different approach that is
better.
:::
::: {.alert .alert-warning}
The greatest risk with design patterns is
over-application. Not every problem can be solved cleanly with an existing
design pattern; don't try to force a problem into a design pattern when a custom
approach will be cleaner. Using design patterns doesn't automatically improve a
software system; it only does so if the design patterns fit. As with many ideas
in software design, the notion that design patterns are good doesn't necessarily
mean that more design patterns are better.
:::
## Installation
You can install the released version of R6P from CRAN with:
``` r
install.packages("R6P")
```
And the development version from GitHub with:
``` r
# install.packages("devtools")
devtools::install_github("tidylab/R6P")
```
## References