You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- CRAN Task View [High-Performance and Parallel Computing with R](http://cran.r-project.org/web/views/HighPerformanceComputing.html)
8
+
- Parallel [Computing with the R Language in a Supercomputing Environment](https://link.springer.com/chapter/10.1007/978-3-642-13872-0_64)
9
+
tasks:
10
+
- Write parallel for loops to speed up computation time.
11
+
---
12
+
13
+
```{r setup, include=FALSE, purl=F}
14
+
source("functions.R")
15
+
source("knitr_header.R")
16
+
```
17
+
18
+
# Reading
19
+
20
+
```{r reading,results='asis',echo=F,purl=F}
21
+
md_bullet(rmarkdown::metadata$reading)
22
+
```
23
+
24
+
25
+
# Tasks
26
+
27
+
```{r tasks,results='asis',echo=F, purl=F}
28
+
md_bullet(rmarkdown::metadata$tasks)
29
+
```
30
+
31
+
## Background
32
+
33
+
```{r cache=F, message=F,warning=FALSE}
34
+
library(tidyverse)
35
+
library(spData)
36
+
library(sf)
37
+
38
+
## New Packages
39
+
library(foreach)
40
+
library(doParallel)
41
+
registerDoParallel()
42
+
getDoParWorkers() # check registered cores
43
+
```
44
+
45
+
46
+
Write an Rmd script that:
47
+
48
+
* Loads the `world` dataset in the `spData` package
49
+
* Runs a parallel `foreach()` to loop over countries (`name_long`) and:
50
+
*`filter` the world object to include only on country at a time.
51
+
* use `st_is_within_distance` to find the distance from that country to all other countries in the `world` object within 100000m Set `sparse=F` to return a simple array of `T` for countries within the distance.
52
+
* set `.combine=rbind` to return a simple matrix.
53
+
* Confirm that you get the same answer without using foreach:
54
+
* imply use `st_is_within_distance` with the transformed `world` object as both `x` and `y` object.
55
+
* compare the results with `identical()`
56
+
* you can also check the time difference with `system.time()`.
- CRAN Task View [High-Performance and Parallel Computing with R](http://cran.r-project.org/web/views/HighPerformanceComputing.html)
8
+
- Parallel [Computing with the R Language in a Supercomputing Environment](https://link.springer.com/chapter/10.1007/978-3-642-13872-0_64)
9
+
tasks:
10
+
- Write parallel for loops to speed up computation time.
11
+
---
12
+
13
+
14
+
15
+
# Reading
16
+
17
+
- list(`CRAN [Task View` = "High-Performance and Parallel Computing with R](http://cran.r-project.org/web/views/HighPerformanceComputing.html)")
18
+
- Parallel [Computing with the R Language in a Supercomputing Environment](https://link.springer.com/chapter/10.1007/978-3-642-13872-0_64)
19
+
20
+
21
+
# Tasks
22
+
23
+
- Write parallel for loops to speed up computation time.
24
+
25
+
## Background
26
+
27
+
28
+
```r
29
+
library(tidyverse)
30
+
library(spData)
31
+
library(sf)
32
+
33
+
## New Packages
34
+
library(foreach)
35
+
library(doParallel)
36
+
registerDoParallel()
37
+
getDoParWorkers() # check registered cores
38
+
```
39
+
40
+
```
41
+
## [1] 2
42
+
```
43
+
44
+
45
+
Write an Rmd script that:
46
+
47
+
* Loads the `world` dataset in the `spData` package
48
+
* Runs a parallel `foreach()` to loop over countries (`name_long`) and:
49
+
*`filter` the world object to include only on country at a time.
50
+
* use `st_is_within_distance` to find the distance from that country to all other countries in the `world` object within 100000m Set `sparse=F` to return a simple array of `T` for countries within the distance.
51
+
* set `.combine=rbind` to return a simple matrix.
52
+
* Confirm that you get the same answer without using foreach:
53
+
* imply use `st_is_within_distance` with the transformed `world` object as both `x` and `y` object.
54
+
* compare the results with `identical()`
55
+
* you can also check the time difference with `system.time()`.
56
+
57
+
58
+
59
+
This approach could be used to identify which countries were 'close' to others. For example, these countries are within 10^{5}m of Costa Rica:
- Documentation for [RMarkdown Websites](https://rmarkdown.rstudio.com/rmarkdown_websites.htm)
8
9
tasks:
9
10
- Commit your first draft of your project to GitHub
10
11
---
@@ -22,6 +23,12 @@ source("knitr_header.R")
22
23
md_bullet(rmarkdown::metadata$reading)
23
24
```
24
25
26
+
# Tasks
27
+
28
+
```{r reading,results='asis',echo=F}
29
+
md_bullet(rmarkdown::metadata$tasks)
30
+
```
31
+
25
32
### First Draft
26
33
27
34
The first draft of your project will be assessed by your peers in GitHub. The objectives of the peer evaluation are:
@@ -30,3 +37,18 @@ The first draft of your project will be assessed by your peers in GitHub. The ob
30
37
* Provide an opportunity to share your knowledge to improve their project
31
38
32
39
You should use the project website template (or similar) to generate a html version of your project report. If your project requires any data not available in public repositories, you should put it in a folder called `/data` in your project's home directory and then import it into R with `read.csv('data/filname.csv')` or similar so that anyone with a copy of the repository can re-create the HTML output.
40
+
41
+
## Required components of first draft
42
+
43
+
1)**Introduction**[~ 200 words]: Clearly stated background and questions / hypotheses / problems being addressed. Sets up the analysis in an interesting and compelling way.
44
+
2)**Data**: Script downloads at least one dataset automatically through the internet or loads the data from the `data/` folder. This could use a direct download (e.g. download.file()) or an API (e.g. anything from ROpenSci).
45
+
3)**Figure**: The HTML file includes at least one figure of the data.
46
+
2)**Reproducibility**: The .Rmd should generate the HTML output when "Build Website" is clicked.
47
+
48
+
### Confirming 'reproducibility'
49
+
50
+
After pushing the files to GitHub, try downloading it as a zip file, opening in RStudio, and clicking build website - it should work.
51
+
52
+
## Common issues
53
+
54
+
1) Importing data from somewhere on your computer. You should not have any commands such as `read.csv("~/projects/inputdata.csv")` that read any data from your computer other than the `data/` folder in your repository.
- Commit your first draft of your project to GitHub
24
+
20
25
### First Draft
21
26
22
27
The first draft of your project will be assessed by your peers in GitHub. The objectives of the peer evaluation are:
@@ -25,3 +30,18 @@ The first draft of your project will be assessed by your peers in GitHub. The ob
25
30
* Provide an opportunity to share your knowledge to improve their project
26
31
27
32
You should use the project website template (or similar) to generate a html version of your project report. If your project requires any data not available in public repositories, you should put it in a folder called `/data` in your project's home directory and then import it into R with `read.csv('data/filname.csv')` or similar so that anyone with a copy of the repository can re-create the HTML output.
33
+
34
+
## Required components of first draft
35
+
36
+
1)**Introduction**[~ 200 words]: Clearly stated background and questions / hypotheses / problems being addressed. Sets up the analysis in an interesting and compelling way.
37
+
2)**Data**: Script downloads at least one dataset automatically through the internet or loads the data from the `data/` folder. This could use a direct download (e.g. download.file()) or an API (e.g. anything from ROpenSci).
38
+
3)**Figure**: The HTML file includes at least one figure of the data.
39
+
2)**Reproducibility**: The .Rmd should generate the HTML output when "Build Website" is clicked.
40
+
41
+
### Confirming 'reproducibility'
42
+
43
+
After pushing the files to GitHub, try downloading it as a zip file, opening in RStudio, and clicking build website - it should work.
44
+
45
+
## Common issues
46
+
47
+
1) Importing data from somewhere on your computer. You should not have any commands such as `read.csv("~/projects/inputdata.csv")` that read any data from your computer other than the `data/` folder in your repository.
- Review at least two other students' projects and make comments via a _pull request_ in GitHub before next class next week.
11
+
- Review at least two other students' projects and make comments via a _pull request_ in GitHub.
12
12
- Browse the [Leaflet website](http://rstudio.github.io/leaflet/) and take notes in your readme.md about potential uses in your project. What data could you use? How would you display it?
13
13
- Browse the [HTML Widgets page](http://gallery.htmlwidgets.org/) for many more examples. Take notes in your readme.md about potential uses in your project.
14
14
---
@@ -25,29 +25,47 @@ source("knitr_header.R")
25
25
```{r reading,results='asis',echo=F}
26
26
md_bullet(rmarkdown::metadata$reading)
27
27
```
28
+
28
29
# Tasks
29
30
30
-
```{rreading,results='asis',echo=F}
31
+
```{rtasks,results='asis',echo=F}
31
32
md_bullet(rmarkdown::metadata$tasks)
32
33
```
33
34
34
-
## Evaluation Instructions
35
+
# Project Peer Evaluation
36
+
37
+
## Instructions
38
+
39
+
Select two repositories and evaluate them according to the instructions listed in the [Project First Draft task](TK_11.html)
40
+
41
+

35
42
36
-
Select two repositories and evaluate them according to the instructions and rubric below.
43
+
### Download and reproduce the project
37
44
38
-
1) Explore the final projects in the [class repositor](https://github.com/AdamWilsonLabEDU)
39
-
2)Open the repository and check if there have already been two reviews by checking if there are 2 (or more) "Pull Requests". For example, in the image below, there are 0 pull requests, so this repository would be available for you to review. If there are already 2 pull requests, select another repository.
40
-
2) Go to the github page linked in the assignment and download the repository as a zip file (click on the <imgsrc='assets/download.png'width=100> button).
45
+
1) Explore the final projects in the [class repository](https://github.com/AdamWilsonLabEDU?q=finalproject)
46
+
2)Select two projects that do not already have two evaluations (pull requests). For example, in the image above, there are 0 pull requests, so this repository would be available for you to review. If there are already 2 pull requests, select another repository.
47
+
2) Go to the github page linked in the assignment and download the repository as a zip file (click on the <imgsrc='project_assets/download.png'width=100> button).
41
48
3) Unzip the file after it downloads
42
-
4) Open the project or `index.Rmd` in RStudio and click `knit` or `Build Website` in the `Build` tab in the upper right.
43
-
44
-
Evaluate the following provide any feedback via pull request.
45
-
1) Website
46
-
1)**Introduction**[~ 200 words]: Clearly stated background and questions / hypotheses / problems being addressed. Sets up the analysis in an interesting and compelling way.
47
-
2)**Data**: Script downloads at least one dataset automatically through the internet. This could use a direct download (e.g. download.file()) or an API (anything from ROpenSci).
48
-
3)**Figure**: The HTML file includes at least one figure of the data.
49
-
2)**Output:** The .Rmd produces HTML output with
50
-
1) section headers for all the major sections of the paper
51
-
2) a draft of the complete introduction.
49
+
4) Open the project or `index.Rmd` in RStudio and click `Build Website` in the `Build` tab in the upper right.
50
+
5) Evaluate whether the project meets the specifications listed in the [Project First Draft task](TK_11.html)
51
+
52
+
53
+
### Provide feedback and evaluation via pull request
54
+
55
+
After you reproduce the project, you will provide feedback via pull request.
56
+
57
+
The following video will walk you through the steps of providing feedback via a pull request.
1) In the "Code" tab of the github page for the project, click on the file you want to provide feedback on (typically this will be `index.Rmd`)
61
+
2) Click the pencil icon on the right side to edit the file
62
+
3) You can make changes or comment on the code
63
+
* To make changes, simply edit the text
64
+
* To comment, you must still make some sort of change on the lines where you want to cmment. The easiest thing is simply to add a space at the end of the line (as I do in the video above).
65
+
4) At the bottom of the file, there is a section called "Commit Changes", select the button for **Create a new branch for this commit and start a pull request.** and name the new branch `project_feedback_githubusername`
66
+
5) Click "Propose File change"
67
+
6) Click on the button "Files Changed #1" near the middle of the next page
68
+
7) Hover over lines you would like to comment on and click the little blue plus button. Then enter your comment and select "Add single comment"
69
+
6) Repeat steps 2-6 for any additional files you want to comment on
52
70
53
71
Be sure to install any required libraries (do not complain if it fails because you don't have a library installed).
0 commit comments