Skip to content

Commit d613699

Browse files
committed
populating workshop notes
1 parent 2c2ea66 commit d613699

Some content is hidden

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

51 files changed

+1959
-27
lines changed

Melb_HS/bilby_tutorial/bilby_tutorial.Rmd

+9
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,15 @@ Hey math boffins, welcome to the coding with R class! Let me introduce you to ou
3636
- We are going to learn about the software R, and the language of data analysis. There's a lot of things to learn. Its ok if you can't remember it all. Most important thing is to have fun and play, break things and fix them, try out new stuff!
3737
- We will have breaks whenever you feel you want them - there are lamingtons and cupcakes for morning and afternoon tea. And we are planning to order pizza for lunch unless there is a better idea.
3838

39+
CODE of CONDUCT:
40+
41+
1. Be positive
42+
2. Be inclusive
43+
3. Ask for help, and give some help
44+
45+
46+
MATERIALS for WORKSHOP:
47+
3948
*These notes can be found at https://dicook.shinyapps.io/bilby_tutorial/ * and example web apps can be found at https://dicook.shinyapps.io/pisa/ and https://dicook.shinyapps.io/pisa_world/.
4049

4150
## Let's get started learning R!

Melb_HS/bilby_tutorial/bilby_tutorial.html

+33-26
Large diffs are not rendered by default.
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading

Melb_HS/pisa_world/app.R

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
#
99
library(tidyverse)
1010
library(gridExtra)
11-
library(plotly)
1211
library(ggthemes)
1312
library(ggmap)
1413
library(forcats)

NZ_girls/Speech/Speech.Rproj

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

NZ_girls/Speech/app.R

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# credits to @yihui
2+
# https://github.com/yihui/shiny-apps/tree/master/voice
3+
# adapted the code above to ggplotly
4+
library(shiny)
5+
library(plotly)
6+
library(ggplot2)
7+
load("data/pisa_au.rda")
8+
9+
shinyApp(
10+
ui = fluidPage(
11+
singleton(tags$head(
12+
tags$script(src="//cdnjs.cloudflare.com/ajax/libs/annyang/2.6.0/annyang.min.js"),
13+
includeScript('init.js')
14+
)),
15+
div(
16+
style = 'display: block; margin: auto; width: 100%; max-width: 1000px',
17+
plotlyOutput("scatterplot", height = "100%"),
18+
helpText(
19+
'You are recommended to use Google Chrome to play with this app.',
20+
'To change the title, say something that starts with "title", e.g.',
21+
'"title I love the R language", or "title Good Morning".',
22+
'To change the color of points, say something that starts with "color",',
23+
'e.g. color "blue", or color "green". When the app is unable to recognize the color,',
24+
'the points will turn gray.',
25+
'To add a regression line, say "regression".',
26+
'To make the points bigger or smaller, say "bigger" or "smaller".'
27+
)
28+
)
29+
),
30+
server = function(input, output) {
31+
output$scatterplot <- renderPlotly({
32+
col <- input$color
33+
if (length(col) == 0 || !(col %in% colors())) {
34+
col <- "grey10"
35+
}
36+
p <- ggplot(pisa_au, aes(x = math, y = read)) +
37+
geom_point(colour = col, size = input$bigger, alpha = 0.7) +
38+
facet_grid(~ gender) +
39+
theme(aspect.ratio = 1)
40+
41+
if (input$yes != "no") {
42+
p <- p + geom_smooth(method = "lm", se = TRUE)
43+
}
44+
45+
p <- p + ggtitle(input$title)
46+
47+
ggplotly(p)
48+
})
49+
}
50+
)

NZ_girls/Speech/data/pisa_au.rda

644 KB
Binary file not shown.

NZ_girls/Speech/init.js

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
var initVoice = function() {
2+
if (annyang) {
3+
var bigger = 1;
4+
Shiny.onInputChange('title', 'hello world');
5+
Shiny.onInputChange('color', 'black');
6+
Shiny.onInputChange('bigger', 1);
7+
Shiny.onInputChange('yes', 'no');
8+
var commands = {
9+
'title *title': function(title) {
10+
Shiny.onInputChange('title', title);
11+
},
12+
'color :color': function(color) {
13+
Shiny.onInputChange('color', color);
14+
},
15+
'bigger': function() {
16+
bigger += 1;
17+
Shiny.onInputChange('bigger', bigger);
18+
},
19+
'smaller': function() {
20+
if (bigger >= 1.5) {
21+
bigger -= 1;
22+
Shiny.onInputChange('bigger', bigger);
23+
}
24+
},
25+
'regression': function() {
26+
Shiny.onInputChange('yes', Math.random());
27+
}
28+
};
29+
annyang.addCommands(commands);
30+
annyang.start();
31+
}
32+
};
33+
34+
$(function() {
35+
setTimeout(initVoice, 10);
36+
});
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
name: Speech
2+
title: Speech
3+
account: dicook
4+
server: shinyapps.io
5+
appId: 229323
6+
bundleId: 1045698
7+
url: https://dicook.shinyapps.io/Speech/
8+
when: 1508995534.64886
9+
asMultiple: FALSE
10+
asStatic: FALSE

NZ_girls/kea_tutorial/css/logo.css

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.tutorialTitle:before {
2+
content: url("../images/forwards.png") url("../images/rladies.png");
3+
display: block;
4+
}

NZ_girls/kea_tutorial/images/di.jpg

6.8 KB
Loading

NZ_girls/kea_tutorial/images/earo.jpg

32.7 KB
Loading

NZ_girls/kea_tutorial/images/fdb1.png

52.4 KB
Loading

NZ_girls/kea_tutorial/images/fdb2.png

69.2 KB
Loading
23.2 KB
Loading

NZ_girls/kea_tutorial/images/forwards.svg

+165
Loading
50.2 KB
Loading

NZ_girls/kea_tutorial/images/nick.png

62.9 KB
Loading
13.5 KB
Loading
520 KB
Loading
110 KB
Loading

0 commit comments

Comments
 (0)