-
Notifications
You must be signed in to change notification settings - Fork 124
/
Copy pathindex.Rmd
97 lines (87 loc) · 4.07 KB
/
index.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
---
title: "Interactive Web-Based Data Visualization with R, Plotly, and Shiny"
author: "Carson Sievert"
date: "`r Sys.Date()`"
documentclass: krantz
bibliography: [book.bib, packages.bib]
biblio-style: apalike
link-citations: yes
colorlinks: yes
lot: false
lof: false
site: bookdown::bookdown_site
description: "A useR guide to creating highly interactive graphics for exploratory and expository visualization."
github-repo: ropensci/plotly
twitter-handle: cpsievert
#cover-image: images/plotly.png
always_allow_html: yes
fontsize: 12pt
monofont: "Source Code Pro"
monofontoptions: "Scale=0.7"
---
```{r setup, include=FALSE}
library(knitr)
# global chunk options
opts_chunk$set(
message = FALSE,
warning = FALSE,
comment = "#>",
collapse = TRUE,
cache = TRUE,
fig.show = "hold",
fig.align = "center"
)
# conditionally global chunk options
if (knitr::is_latex_output()) {
opts_chunk$set(
# why does specifying this lead to so many issues?
# https://github.com/yihui/bookdown-crc/issues/3
# https://github.com/hadley/adv-r/commit/4f99def#diff-04c6e90f
out.width = "\\textwidth",
fig.width = 8,
fig.asp = 0.618,
fig.pos = "H"
)
}
if (knitr::is_html_output()) {
opts_chunk$set(out.width = "100%")
knit_hooks$set(summary = function(before, options, envir) {
if (length(options$summary)) {
if (before) {
return(sprintf("<details><summary>%s</summary>\n", options$summary))
} else {
return("\n</details>")
}
}
})
}
include_vimeo <- function(id, width = "100%", height = "400") {
if (knitr::is_latex_output()) {
img <- paste0("vimeo-images/", id, "/final.png")
knitr::include_graphics(img)
} else {
url <- sprintf("https://player.vimeo.com/video/%s?title=0&byline=0&portrait=0", id)
htmltools::tags$iframe(
src = url,
width = width,
height = height,
frameborder = "0",
seamless = "seamless",
webkitAllowFullScreen = NA,
mozallowfullscreen = NA,
allowFullScreen = NA
)
}
}
options(
dplyr.print_min = 6, dplyr.print_max = 6,
digits = 3, htmltools.dir.version = FALSE,
width = 55, formatR.indent = 2
)
```
<!--
NOTE: comment out this portion when compiling pdf!
# Welcome {-}
<a href="http://bit.ly/r-plotly-book"><img src="crc-cover.png" width="255" height="375" alt="Cover image" align="right" style="margin: 0 1em 0 1em" /></a> This is the website for **"Interactive web-based data visualization with R, plotly, and shiny"**. In this book, you'll gain insight and practical skills for creating interactive and dynamic web graphics for data analysis from `R`. It makes heavy use of **plotly** for rendering graphics, but you'll also learn about other `R` packages that augment a data science workflow, such as the [**tidyverse**](https://www.tidyverse.org/) and [**shiny**](https://shiny.rstudio.com/). Along the way, you'll gain insight into best practices for visualization of high-dimensional data, statistical graphics, and graphical perception. By mastering these concepts and tools, you'll impress your colleagues with your ability to *generate more informative, engaging, and repeatable interactive graphics* using free software that you can share over email, export to PDF/PNG, and more.
An online version of this book, available at <https://plotly-r.com>, is free to use and is licensed under the [Creative Commons Attribution-NonCommercial-NoDerivs 3.0](https://creativecommons.org/licenses/by-nc-nd/3.0/us/) United States License. If you’d like a **physical copy** of the book, you can order it from [CRC Press](https://www.crcpress.com/Interactive-Web-Based-Data-Visualization-with-R-plotly-and-shiny/Sievert/p/book/9781138331457) and [Amazon](https://www.amazon.com/Interactive-Web-Based-Visualization-plotly-Chapman/dp/113833149X). Both the print and online versions of the book are written in [**rmarkdown**](https://rmarkdown.rstudio.com/) with [**bookdown**](https://bookdown.org) and those source files are available at <https://github.com/cpsievert/plotly_book>. The online version will continue to evolve in between reprints of the physical book.
--->