-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.Rmd
82 lines (59 loc) · 2.89 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
---
output: github_document
---
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# mtb - Toolkit for Assisting Kitchen and Garden Projects
<!-- badges: start -->
[![CRAN status](https://www.r-pkg.org/badges/version/mtb)](https://CRAN.R-project.org/package=mtb)
[![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental)
<!-- badges: end -->
The purpose of this package is to share a collection of functions the author wrote during weekends for managing
kitchen and garden tasks, e.g. making plant growth charts or Thanksgiving kitchen schedule charts, etc.
Functions might include but not limited to:
(1) aiding summarizing time related data;
(2) generating axis transformation from data; and
(3) aiding `Markdown` (with `HTML` output) and `Shiny` files editing.
## Installation
You can install the newest version of mtb like so:
``` r
install.packages('mtb')
```
You can install the development version of mtb like so:
``` r
devtools::install_github('yh202109/mtb',ref='main')
```
## Example - Selecting and Testing Colors
This is a basic example which shows you how to automatically select colors for individual groups by 3 major colors, blue, cyan and orange. The first argument represent group values. The second argument specify the order of $a$ to $g$, the third argument specifies that group $a$ is assigned to the black color, and group $b$ is assigned to the gray color.
```{r example_color_1}
library(mtb)
colvect = color_set_palette(c('a','b','d','c','e','f','g'), c(1,2,4,3,5,6,7),black='a',gray9='b',cols=c('blue', 'cyan','orange'))
```
This is a basic example which shows you how to quickly test selected colors:
```{r example_color_2, out.width='60%'}
color_test_palette(colvect, type='line')
color_test_palette(colvect, type='bar')
```
## Example - *R markdown* or *Shiny* components
This is a basic example which shows you how to format a string:
```{r example_rmd_1}
add_colored_str('Example - Warning', color=c(255,0,0), bold=TRUE, fontsize=1.5)
```
This is an example which shows you how to add a default box:
```{r example_rmd_2}
add_colored_box(info='additional information')
```
This is an example which shows you how to add a warning box:
```{r example_rmd_3}
add_colored_box(type='yellow-warning', info='Here is the warning message.')
```
# Warranty and Disclaimer
```{r, echo=FALSE}
mtb::add_colored_box(type='blue-default', width=0.95, label='Important', info='THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY.')
```