Skip to content

Commit 89d711c

Browse files
author
Barbara Borges Ribeiro
authored
Merge pull request #161 from rstudio/v0.5.1
Release candidate v0.5.1
2 parents dd4440a + 03fc691 commit 89d711c

File tree

50 files changed

+69327
-48
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+69327
-48
lines changed

.Rbuildignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,5 @@ README.R?md
55
^inst/examples/.+\.html
66
^inst/examples/.+_files
77
^inst/examples/.+\.Rnb\.cached
8-
9-
8+
^examples/*
109

DESCRIPTION

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
Package: flexdashboard
22
Type: Package
33
Title: R Markdown Format for Flexible Dashboards
4-
Version: 0.5
4+
Version: 0.5.1
55
Description: Format for converting an R Markdown document to a grid oriented
66
dashboard. The dashboard flexibly adapts the size of it's components to the
77
containing web page.
88
Authors@R: c(
9-
person("JJ", "Allaire", role = c("aut", "cre"), email = "[email protected]"),
9+
person("Barbara", "Borges", role = c("aut", "cre"), email = "[email protected]"),
10+
person("JJ", "Allaire", role = "aut", email = "[email protected]"),
1011
person(family = "RStudio", role = "cph"),
1112
person(family = "Keen IO", role = c("ctb", "cph"), comment = "Dashboard CSS"),
1213
person("Abdullah", "Almsaeed", role = c("ctb", "cph"), comment = "Dashboard CSS"),

NEWS.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
flexdashboard 0.5.1
2+
===========
3+
4+
* Fixed [#149](https://github.com/rstudio/flexdashboard/issues/149): a compatability issue when using Pandoc 2.0. ([#150](https://github.com/rstudio/flexdashboard/pull/150))
5+
6+
* Fixed [#139](https://github.com/rstudio/flexdashboard/issues/139): remove previous valueBox handlers when rebinding.
7+
8+
* Update to roxygen2 6.0.
9+
10+
flexdashboard 0.5.0
11+
===========
12+
13+
(tagged @ commit [#d99dd62](https://github.com/rstudio/flexdashboard/commit/d99dd62d49375d414336386e11da8d1807c01fae))
14+
15+
* Don't hook graphics device option for `fig_mobile` if it's a data chunk (this broke knitr caching for `shiny_prerendered` data chunks).
16+
17+
18+
flexdashboard 0.4.0
19+
===========
20+
(tagged @ commit [#0a88a91](https://github.com/rstudio/flexdashboard/commit/0a88a91654a1a18b30b23b60097f6fb16ad2c317))
21+
22+
* Add support for `target` field in navbar links (e.g. target: "_blank").
23+
24+
* Fixed [#100](https://github.com/rstudio/flexdashboard/issues/100): problem w/ embedding source code for Rmd w/ spaces in path.
25+
26+
* Fixed [#106](https://github.com/rstudio/flexdashboard/issues/106): ensure that previous bg class on valueBox is cleared.
27+
28+
29+
flexdashboard 0.3.0
30+
===========
31+
(tagged @ commit [#2b6eb71](https://github.com/rstudio/flexdashboard/commit/2b6eb71b1f75078ea36b33d5aa3c9f8d4ace639b))
32+
33+
* Support `.hidden` attribute for pages to hide them from the navbar.
34+
35+
* Scroll sidebar when content overflows vertically.
36+
37+
* Correct handling for storyboard notes in mobile layout.
38+
39+
* Handle titles with extended characters (auto-assign id if pandoc doesn't).
40+
41+
* Handle page titles with punctuation (sanitize id for bootstrap tabs).
42+
43+
* Use `pre_knit` hook to get access to the source file path.
44+
45+
* Restore original DT options after rendering.
46+
47+
48+
flexdashboard 0.2.0
49+
===========
50+
(tagged @ commit [#64d975f](https://github.com/rstudio/flexdashboard/commit/64d975f962dd3eca8ab2067f55a35ec05d72d4ac))
51+
52+
* Initial release to CRAN.
53+
54+
55+
flexdashboard 0.1.0
56+
===========
57+
(tagged @ commit [#990d10c](https://github.com/rstudio/flexdashboard/commit/990d10c2b3c4a8fa2029a7723f7e1a4ce86d3717))
58+
59+
* init commit!

examples/00_pandoc-version-test-layout/dashboard-pandoc2.0.3.html

Lines changed: 4951 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
title: "Pandoc 1.x -> 2.x test"
3+
output:
4+
flexdashboard::flex_dashboard:
5+
orientation: columns
6+
source_code: embed
7+
---
8+
9+
```{r, include = FALSE}
10+
library(ggplot2)
11+
library(dplyr)
12+
```
13+
14+
```{r}
15+
paste("Pandoc version:", rmarkdown::pandoc_version())
16+
```
17+
18+
Column
19+
-------------------------------------
20+
21+
### Chart 1
22+
23+
```{r}
24+
DT::datatable(mtcars)
25+
```
26+
27+
Column
28+
-------------------------------------
29+
30+
### Chart 2
31+
32+
```{r}
33+
ggplot(mtcars, aes(mpg, wt)) + geom_boxplot()
34+
```
35+
36+
### Chart 3
37+
38+
```{r}
39+
ggplot(mtcars, aes(mpg, wt)) + geom_point()
40+
```

examples/01_NBA-scoring-with-d3heatmap/dashboard-pandoc2.0.3.html

Lines changed: 5115 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
title: "NBA Scoring (2008)"
3+
output:
4+
flexdashboard::flex_dashboard:
5+
orientation: rows
6+
social: menu
7+
source_code: embed
8+
---
9+
10+
```{r setup, include=FALSE}
11+
library(knitr)
12+
library(d3heatmap)
13+
library(flexdashboard)
14+
15+
url <- "http://datasets.flowingdata.com/ppg2008.csv"
16+
nba_players <- read.csv(url, row.names = 1)
17+
```
18+
19+
### Stats by Player {data-width=650}
20+
21+
```{r}
22+
d3heatmap(nba_players, scale = "column")
23+
```
24+
25+
### Top Scorers {data-width=350}
26+
27+
```{r}
28+
knitr::kable(nba_players[1:20,c("G", "MIN", "PTS")])
29+
```
30+

examples/02_ggplotly-ggplot2-geoms/dashboard-pandoc2.0.3.html

Lines changed: 4955 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 163 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,163 @@
1+
---
2+
title: "ggplotly geoms"
3+
author: "Carson Sievert"
4+
output:
5+
flexdashboard::flex_dashboard:
6+
orientation: rows
7+
social: menu
8+
source_code: embed
9+
---
10+
11+
```{r setup, include=FALSE}
12+
library(ggplot2)
13+
library(plotly)
14+
library(plyr)
15+
library(flexdashboard)
16+
17+
# Make some noisily increasing data
18+
set.seed(955)
19+
dat <- data.frame(cond = rep(c("A", "B"), each=10),
20+
xvar = 1:20 + rnorm(20,sd=3),
21+
yvar = 1:20 + rnorm(20,sd=3))
22+
```
23+
24+
geom_point
25+
=======================================================================
26+
27+
Row
28+
-----------------------------------------------------------------------
29+
30+
### Scatter Chart with geom_point
31+
32+
```{r}
33+
p <- ggplot(dat, aes(x=xvar, y=yvar)) +
34+
geom_point(shape=1) # Use hollow circles
35+
ggplotly(p)
36+
```
37+
38+
39+
### geom_smooth Linear Regression
40+
41+
```{r}
42+
p <- ggplot(dat, aes(x=xvar, y=yvar)) +
43+
geom_point(shape=1) + # Use hollow circles
44+
geom_smooth(method=lm) # Add linear regression line
45+
ggplotly(p)
46+
```
47+
48+
Row
49+
-----------------------------------------------------------------------
50+
51+
### geom_smooth with Loess Smoothed Fit
52+
53+
```{r}
54+
p <- ggplot(dat, aes(x=xvar, y=yvar)) +
55+
geom_point(shape=1) + # Use hollow circles
56+
geom_smooth() # Add a loess smoothed fit curve with confidence region
57+
ggplotly(p)
58+
```
59+
60+
### Constraining Slope with stat_smooth
61+
62+
```{r}
63+
n <- 20
64+
x1 <- rnorm(n); x2 <- rnorm(n)
65+
y1 <- 2 * x1 + rnorm(n)
66+
y2 <- 3 * x2 + (2 + rnorm(n))
67+
A <- as.factor(rep(c(1, 2), each = n))
68+
df <- data.frame(x = c(x1, x2), y = c(y1, y2), A = A)
69+
fm <- lm(y ~ x + A, data = df)
70+
71+
p <- ggplot(data = cbind(df, pred = predict(fm)), aes(x = x, y = y, color = A))
72+
p <- p + geom_point() + geom_line(aes(y = pred))
73+
ggplotly(p)
74+
```
75+
76+
geom_density
77+
=======================================================================
78+
79+
Row
80+
-----------------------------------------------------------------------
81+
82+
### stat_density Example
83+
84+
```{r}
85+
dfGamma = data.frame(nu75 = rgamma(100, 0.75),
86+
nu1 = rgamma(100, 1),
87+
nu2 = rgamma(100, 2))
88+
89+
dfGamma = stack(dfGamma)
90+
91+
p <- ggplot(dfGamma, aes(x = values)) +
92+
stat_density(aes(group = ind, color = ind),position="identity",geom="line")
93+
ggplotly(p)
94+
```
95+
96+
### Add Conditional Density Curves to Plot
97+
98+
```{r}
99+
dim1 <- c(rnorm(100, mean=1), rnorm(100, mean=4))
100+
dim2 <- rnorm(200, mean=1)
101+
cat <- factor(c(rep("a", 100), rep("b", 100)))
102+
mydf <- data.frame(cbind(dim2, dim1, cat))
103+
p <- ggplot(data=mydf, aes(x=dim1, y=dim2, colour=as.factor(cat))) +
104+
geom_point() +
105+
stat_density(aes(x=dim1, y=(-2+(..scaled..))),
106+
position="identity", geom="line")
107+
108+
# extract the x range to make the new densities align with y-axis
109+
xrange <- ggplot_build(p)$layout$panel_ranges[[1]]$x.range
110+
111+
## Get densities of dim2
112+
ds <- do.call(rbind, lapply(unique(mydf$cat), function(lev) {
113+
dens <- with(mydf, density(dim2[cat==lev]))
114+
data.frame(x=dens$y+xrange[1], y=dens$x, cat=lev)
115+
}))
116+
117+
p <- p + geom_path(data=ds, aes(x=x, y=y, color=factor(cat)))
118+
119+
ggplotly(p)
120+
```
121+
122+
Row
123+
-----------------------------------------------------------------------
124+
125+
### geom_density and facet_wrap Together
126+
127+
```{r}
128+
dd<-data.frame(matrix(rnorm(144, mean=2, sd=2),72,2),c(rep("A",24),rep("B",24),rep("C",24)))
129+
colnames(dd) <- c("x_value", "Predicted_value", "State_CD")
130+
131+
dd <- data.frame(
132+
predicted = rnorm(72, mean = 2, sd = 2),
133+
state = rep(c("A", "B", "C"), each = 24)
134+
)
135+
136+
grid <- with(dd, seq(min(predicted), max(predicted), length = 100))
137+
normaldens <- ddply(dd, "state", function(df) {
138+
data.frame(
139+
predicted = grid,
140+
density = dnorm(grid, mean(df$predicted), sd(df$predicted))
141+
)
142+
})
143+
144+
p <- ggplot(dd, aes(predicted)) +
145+
geom_density() +
146+
geom_line(aes(y = density), data = normaldens, colour = "red") +
147+
facet_wrap(~ state)
148+
ggplotly(p)
149+
```
150+
151+
### Density and Scatterplot Overlay Using geom_density
152+
153+
```{r}
154+
df <- data.frame(x <- rchisq(1000, 10, 10),
155+
y <- rnorm(1000))
156+
157+
p <- ggplot(df, aes(x, y)) +
158+
geom_point(alpha = 0.5) +
159+
geom_density_2d() +
160+
theme(panel.background = element_rect(fill = '#ffffff'))
161+
162+
ggplotly(p)
163+
```
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
---
2+
title: "Gene Expression Biclustering"
3+
author: "Bryan Lewis"
4+
output:
5+
flexdashboard::flex_dashboard:
6+
orientation: rows
7+
social: menu
8+
source_code: embed
9+
runtime: shiny
10+
---
11+
12+
```{r global, include=FALSE}
13+
# load data in 'global' chunk so it can be shared by all users of the dashboard
14+
library(biclust)
15+
data(BicatYeast)
16+
set.seed(1)
17+
res <- biclust(BicatYeast, method=BCPlaid(), verbose=FALSE)
18+
```
19+
20+
Inputs {.sidebar}
21+
-----------------------------------------------------------------------
22+
23+
```{r}
24+
selectInput("clusterNum", label = h3("Cluster number"),
25+
choices = list("1" = 1, "2" = 2, "3" = 3, "4" = 4, "5" = 5),
26+
selected = 1)
27+
```
28+
29+
Microarray data matrix for 80 experiments with Saccharomyces Cerevisiae
30+
organism extracted from R's `biclust` package.
31+
32+
Sebastian Kaiser, Rodrigo Santamaria, Tatsiana Khamiakova, Martin Sill, Roberto
33+
Theron, Luis Quintales, Friedrich Leisch and Ewoud De Troyer. (2015). biclust:
34+
BiCluster Algorithms. R package version 1.2.0.
35+
http://CRAN.R-project.org/package=biclust
36+
37+
Row
38+
-----------------------------------------------------------------------
39+
40+
### Heatmap
41+
42+
```{r}
43+
44+
num <- reactive(as.integer(input$clusterNum))
45+
46+
col = colorRampPalette(c("red", "white", "darkblue"), space="Lab")(10)
47+
renderPlot({
48+
p = par(mai=c(0,0,0,0))
49+
heatmapBC(BicatYeast, res, number=num(), xlab="", ylab="",
50+
order=TRUE, useRaster=TRUE, col=col)
51+
par(p)
52+
})
53+
```
54+
55+
56+
Row {.tabset}
57+
-----------------------------------------------------------------------
58+
59+
### Parallel Coordinates
60+
61+
```{r}
62+
renderPlot(
63+
parallelCoordinates(BicatYeast, res, number=num())
64+
)
65+
```
66+
67+
### Data for Selected Cluster
68+
69+
```{r}
70+
# only display table for values in cluster 4
71+
renderTable(
72+
BicatYeast[which(res@RowxNumber[, num()]), which(res@NumberxCol[num(), ])]
73+
)
74+
```

0 commit comments

Comments
 (0)