-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathREADME.Rmd
166 lines (136 loc) · 2.74 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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# skeleton
<!-- badges: start -->
[](https://github.com/ColinFay/skeleton/actions/workflows/R-CMD-check.yaml)
<!-- badges: end -->
The goal of skeleton is to provide [Skeleton CSS](http://getskeleton.com/) for `{shiny}`.
## Installation
You can install the development version of `{skeleton}` from [GitHub](https://github.com/) with:
``` r
# install.packages("devtools")
devtools::install_github("ColinFay/skeleton")
```
# skeleton
## About
You're reading the doc about version : `r pkgload::pkg_version()`
This README has been compiled on the
```{r}
Sys.time()
```
Here are the test & coverage results :
```{r}
devtools::check(quiet = TRUE)
```
```{r eval = TRUE, message = TRUE}
covr::package_coverage()
```
# Example
## Basic app
```{r eval = FALSE}
library(shiny)
library(skeleton)
ui <- sk_page(
h1("Hello world"),
sk_row(
sk_col(6, "Hello"),
sk_col(6, "World")
),
sk_row(
plotOutput("plot1")
)
)
server <- function(input, output) {
output$plot1 <- renderPlot({
plot(mtcars)
})
}
shinyApp(ui, server)
```
## Built-in dashboard
```{r eval = FALSE}
library(shiny)
library(skeleton)
ui <- sk_page(
sk_header(
h2("A dead simple, responsive boilerplate."),
),
sk_nav(
sk_nav_item(
id = "one",
title = "ONE",
ui = sk_row(
sk_col(
6,
"Hello plot1"
),
sk_col(
6,
plotOutput("plot1")
)
)
),
sk_nav_item(
id = "two",
title = "TWO",
ui = sk_row(
sk_col(
6,
plotOutput("plot2")
),
sk_col(
6,
"Hello plot2"
),
)
),
sk_nav_item(
id = "three",
title = "THREE",
ui = sk_row(
sk_col(
6,
plotOutput("plot3")
),
sk_col(
6,
"Hello plot3"
),
)
)
)
)
shinyApp(ui, function(input, output) {
output$plot1 <- renderPlot({
plot(mtcars)
})
output$plot2 <- renderPlot({
plot(airquality)
})
output$plot3 <- renderPlot({
plot(pressure)
})
})
```
## With golem
You can get a boilerplate of a page or a dashboard when creating an app with golem, using the built-in golem hooks:
```{r eval = FALSE}
golem::create_golem(
"skboilerplate",
project_hook = skeleton::ghook_sk_dashboard
)
golem::create_golem(
"skdashboard",
project_hook = skeleton::ghook_sk_boilerplate
)
```