Skip to content

Commit 46c890b

Browse files
committed
aded files
1 parent 82e545a commit 46c890b

File tree

185 files changed

+50029
-0
lines changed

Some content is hidden

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

185 files changed

+50029
-0
lines changed

Diff for: .gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.Rproj.user
2+
.Rhistory
3+
.RData

Diff for: Makefile

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
2+
HTML_FILES := $(patsubst %.Rmd, %.html ,$(wildcard *.Rmd)) \
3+
$(patsubst %.md, %.html ,$(wildcard *.md))
4+
5+
all: clean html
6+
7+
8+
html: $(HTML_FILES)
9+
10+
%.html: %.Rmd
11+
Rscript compile.R "$<"
12+
13+
%.html: %.md
14+
Rscript compile.R "$<"
15+
16+
showcase_leaflet.html: geog495.RData
17+
18+
geog495.RData:
19+
curl http://geog.uoregon.edu/GeogR/data/Rdata/geog495.RData > geog495.RData
20+
21+
.PHONY: clean
22+
clean:
23+
$(RM) $(HTML_FILES)
24+

Diff for: _config.yml

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
exclude: packrat

Diff for: _output.yaml

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
html_document:
2+
fig_width: 6.0
3+
fig_height: 3.5
4+
self_contained: false
5+
theme: cosmo
6+
highlight: textmate
7+
mathjax: null
8+
lib_dir: libs
9+
includes:
10+
in_header: include/in_header.html
11+
before_body: include/before_body.html
12+
after_body: include/after_body.html
13+

Diff for: compile.R

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
set.seed(100)
2+
options(htmlwidgets.TOJSON_ARGS = list(pretty = TRUE))
3+
Sys.setenv(R_KNITR_OPTIONS = 'knitr.chunk.tidy = FALSE')
4+
f = rmarkdown::render(commandArgs(TRUE))
5+
# remove version numbers in HTML
6+
r = '-\\d+([.]\\d+){0,3}$'
7+
v1 = rev(list.files('libs', r, full.names = TRUE))
8+
v2 = gsub(r, '', v1)
9+
x = readLines(f)
10+
for (i in seq_along(v1)) {
11+
x = gsub(v1[i], v2[i], x, fixed = TRUE)
12+
}
13+
# a fix for metricsgraphics
14+
x = gsub('jquery/dist/jquery.min.js', 'jquery/jquery.min.js', x, fixed = TRUE)
15+
# delete lower versions of libraries, and only use higher versions
16+
i = duplicated(v2)
17+
unlink(c(v1[i], v2), recursive = TRUE)
18+
file.rename(v1[!i], v2[!i])
19+
writeLines(x, f)
20+

Diff for: css/styles.css

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
.header {
2+
margin-top: 18px;
3+
}
4+
5+
.header h3 {
6+
padding-top: 10px;
7+
margin-top: 0;
8+
}
9+
10+
.header nav.navbar {
11+
margin-bottom: 12px;
12+
}
13+
14+
.carousel-control.left, .carousel-control.right {
15+
background-image: none
16+
}
17+
18+
#showcase-intro {
19+
margin-bottom: 30px;
20+
}
21+
22+
#showcase-body h3 {
23+
margin-top: 0px;
24+
}
25+
26+
footer {
27+
text-align: center;
28+
font-size: 0.8em;
29+
margin-bottom: 100px;
30+
}
31+
32+
input[type="search"] {
33+
border-radius: 10px;
34+
-moz-border-radius: 10px;
35+
-khtml-border-radius: 10px;
36+
-webkit-border-radius: 10px;
37+
border: solid 1px LightGray;
38+
}
39+
40+
.html-widget-static-bound {
41+
width: 100% !important;
42+
}

Diff for: ggiraph.Rmd

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
title: "ggplot2 extensions: ggiraph"
3+
---
4+
5+
### ggiraph
6+
<http://davidgohel.github.io/ggiraph/introduction.html>
7+
8+
The ggiraph package let R users to make ggplot interactive. The package is an htmlwidget.
9+
10+
```{r, include=FALSE}
11+
# Example from http://davidgohel.github.io/ggiraph/introduction.html
12+
dataset <- mtcars
13+
```
14+
15+
```{r message=FALSE,warning=FALSE}
16+
library(ggplot2)
17+
library(rvg)
18+
library(ggiraph)
19+
20+
mytheme_main <- theme( panel.background = element_blank(),
21+
panel.grid.major = element_line(colour = "#dddddd"),
22+
axis.ticks = element_line(colour = "#dddddd") )
23+
24+
mytheme_map <- theme(
25+
panel.background = element_blank(), axis.title.x = element_blank(),
26+
axis.text = element_blank(), axis.line.x = element_blank(),
27+
axis.line.y = element_blank(), axis.title.y = element_blank(),
28+
axis.ticks.x = element_blank(), axis.ticks.y = element_blank() )
29+
30+
dataset$tooltip <- row.names(dataset)
31+
32+
# geom_point_interactive example
33+
gg_point_1 <- ggplot(dataset, aes(x = disp, y = qsec,
34+
color = wt, tooltip = tooltip ) ) +
35+
geom_point_interactive(size=3)
36+
37+
# htmlwidget call
38+
ggiraph(code = {print(gg_point_1 + mytheme_main)}, width = 7, height = 6)
39+
```

Diff for: ggiraph.html

+218
Large diffs are not rendered by default.

Diff for: ggplot2-exts.github.io.Rproj

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
Version: 1.0
2+
3+
RestoreWorkspace: Default
4+
SaveWorkspace: Default
5+
AlwaysSaveHistory: Default
6+
7+
EnableCodeIndexing: Yes
8+
UseSpacesForTab: Yes
9+
NumSpacesForTab: 2
10+
Encoding: UTF-8
11+
12+
RnwWeave: Sweave
13+
LaTeX: pdfLaTeX
14+
15+
BuildType: Makefile

Diff for: ggstance.Rmd

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
title: "ggplot2 extensions: ggstance"
3+
---
4+
5+
### ggstance
6+
<https://github.com/lionel-/ggstance>
7+
8+
ggstance implements horizontal versions of common ggplot2 geoms.
9+
10+
```{r message=FALSE,warning=FALSE}
11+
library("ggplot2")
12+
library("ggstance")
13+
14+
# Vertical
15+
ggplot(mpg, aes(class, hwy, fill = factor(cyl))) +
16+
geom_boxplot()
17+
18+
# Horizontal with coord_flip()
19+
ggplot(mpg, aes(class, hwy, fill = factor(cyl))) +
20+
geom_boxplot() +
21+
coord_flip()
22+
```

Diff for: ggstance.html

+201
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,201 @@
1+
<!DOCTYPE html>
2+
3+
<html xmlns="http://www.w3.org/1999/xhtml">
4+
5+
<head>
6+
7+
<meta charset="utf-8">
8+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
9+
<meta name="generator" content="pandoc" />
10+
11+
12+
13+
<title>ggplot2 extensions: ggstance</title>
14+
15+
<script src="libs/jquery-1.11.0/jquery.min.js"></script>
16+
<meta name="viewport" content="width=device-width, initial-scale=1" />
17+
<link href="libs/bootstrap-3.3.1/css/cosmo.min.css" rel="stylesheet" />
18+
<script src="libs/bootstrap-3.3.1/js/bootstrap.min.js"></script>
19+
<script src="libs/bootstrap-3.3.1/shim/html5shiv.min.js"></script>
20+
<script src="libs/bootstrap-3.3.1/shim/respond.min.js"></script>
21+
22+
<!-- Styles for this site -->
23+
<link href="css/styles.css" rel="stylesheet">
24+
25+
<!-- Polyfill JS -->
26+
<script src="js/polyfill.js"></script>
27+
28+
<style type="text/css">code{white-space: pre;}</style>
29+
<link rel="stylesheet"
30+
href="libs/highlight/textmate.css"
31+
type="text/css" />
32+
<script src="libs/highlight/highlight.js"></script>
33+
<style type="text/css">
34+
pre:not([class]) {
35+
background-color: white;
36+
}
37+
</style>
38+
<script type="text/javascript">
39+
if (window.hljs && document.readyState && document.readyState === "complete") {
40+
window.setTimeout(function() {
41+
hljs.initHighlighting();
42+
}, 0);
43+
}
44+
</script>
45+
46+
47+
48+
</head>
49+
50+
<body>
51+
52+
<style type = "text/css">
53+
.main-container {
54+
max-width: 940px;
55+
margin-left: auto;
56+
margin-right: auto;
57+
}
58+
code {
59+
color: inherit;
60+
background-color: rgba(0, 0, 0, 0.04);
61+
}
62+
img {
63+
max-width:100%;
64+
height: auto;
65+
}
66+
</style>
67+
<div class="container-fluid main-container">
68+
69+
<!--html_preserve-->
70+
71+
<div class="header">
72+
<nav class="navbar">
73+
<h3 class="navbar-left"><strong>ggplot2</strong> extensions</h3>
74+
<ul class="nav nav-pills navbar-right">
75+
<li role="presentation" id="nav-home"><a href="index.html">Home</a></li>
76+
<li role="presentation" id="nav-showcase"><a href="ggiraph.html">Showcase</a></li>
77+
<li role="presentation" id="nav-github"><a href="https://github.com/ggplot2-exts/ggplot2-exts.github.io">GitHub</a></li>
78+
</ul>
79+
</nav>
80+
</div>
81+
82+
<div class="showcase-header hidden">
83+
84+
<div id = "showcase-intro">
85+
ggplot2 now has an official extension mechanism. This means that others can now easily create their on stats, geoms and positions, and provide them in other packages. This should allow the ggplot2 community to flourish, even as less development work happens in ggplot2 itself. This page showcases these extensions.
86+
</div>
87+
88+
<div class="row">
89+
90+
<div class="col-sm-4">
91+
<div class="list-group">
92+
<a href="ggiraph.html" class="list-group-item">
93+
<h5 class="list-group-item-heading">ggiraph</h5>
94+
<p class="list-group-item-text">Make ggplot interactive</p>
95+
</a>
96+
<a href="ggstance.html" class="list-group-item">
97+
<h5 class="list-group-item-heading">ggstance</h5>
98+
<p class="list-group-item-text">Horizontal Versions of ggplot2 geoms</p>
99+
</a>
100+
<a href="ggtech.html" class="list-group-item">
101+
<h5 class="list-group-item-heading">ggtech</h5>
102+
<p class="list-group-item-text">Tech themes</p>
103+
</a>
104+
105+
</div> <!-- list-group -->
106+
107+
</div> <!-- col-sm-4 -->
108+
109+
<div class="col-sm-8" id="showcase-body">
110+
111+
</div> <!-- col-sm-8 -->
112+
113+
</div> <!-- row -->
114+
115+
</div> <!-- showcase-header -->
116+
117+
<div id="page-body">
118+
119+
<!--/html_preserve-->
120+
121+
<div id="header">
122+
<h1 class="title">ggplot2 extensions: ggstance</h1>
123+
</div>
124+
125+
126+
<div id="ggstance" class="section level3">
127+
<h3>ggstance</h3>
128+
<p><a href="https://github.com/lionel-/ggstance" class="uri">https://github.com/lionel-/ggstance</a></p>
129+
<p>ggstance implements horizontal versions of common ggplot2 geoms.</p>
130+
<pre class="r"><code>library(&quot;ggplot2&quot;)
131+
library(&quot;ggstance&quot;)
132+
133+
# Vertical
134+
ggplot(mpg, aes(class, hwy, fill = factor(cyl))) +
135+
geom_boxplot()</code></pre>
136+
<p><img src="ggstance_files/figure-html/unnamed-chunk-1-1.png" title="" alt="" width="576" /></p>
137+
<pre class="r"><code># Horizontal with coord_flip()
138+
ggplot(mpg, aes(class, hwy, fill = factor(cyl))) +
139+
geom_boxplot() +
140+
coord_flip()</code></pre>
141+
<p><img src="ggstance_files/figure-html/unnamed-chunk-1-2.png" title="" alt="" width="576" /></p>
142+
</div>
143+
144+
145+
</div> <!-- page-body -->
146+
147+
<footer>
148+
<div>&nbsp;</div>
149+
<div>&nbsp;</div>
150+
<div class="text-muted">
151+
Design inspired by <a href="http://www.htmlwidgets.org/index.html" target="_blank">Ramnath Vaidyanathan, Kenton Russell, and RStudio, Inc</a>.
152+
</div>
153+
<div class="text-muted">
154+
Copyright &copy; 2016 The R Community.
155+
</div>
156+
</footer>
157+
158+
<script>
159+
// manage active state of headres and navigation based on current page
160+
161+
$(document).ready(function () {
162+
163+
// compute name of page
164+
href = window.location.pathname;
165+
href = href.substr(href.lastIndexOf('/') + 1);
166+
if (href == "")
167+
href = "index.html";
168+
169+
// main navigation and headers
170+
if (href.startsWith("index")) {
171+
$('#nav-home').addClass('active');
172+
$('.title').addClass('hidden');
173+
} else if (href.startsWith("showcase")) {
174+
$('#nav-showcase').addClass('active');
175+
$("#page-body").detach().appendTo('#showcase-body');
176+
$('.showcase-header').removeClass('hidden');
177+
$('.title').addClass('hidden');
178+
} else if (href.startsWith("develop")) {
179+
$('#nav-develop').addClass('active');
180+
}
181+
182+
// submenu navigation (used by showcase and develop)
183+
$('.list-group a[href="' + href + '"]').addClass('active');
184+
});
185+
186+
</script>
187+
188+
</div>
189+
190+
<script>
191+
192+
// add bootstrap table styles to pandoc tables
193+
$(document).ready(function () {
194+
$('tr.header').parent('thead').parent('table').addClass('table table-condensed');
195+
});
196+
197+
</script>
198+
199+
200+
</body>
201+
</html>

Diff for: ggstance_files/figure-html/unnamed-chunk-1-1.png

32.4 KB
Loading

Diff for: ggstance_files/figure-html/unnamed-chunk-1-2.png

38.6 KB
Loading

0 commit comments

Comments
 (0)