-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
979 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
--- | ||
title: "Reproducibility Lab" | ||
output: html_document | ||
editor_options: | ||
chunk_output_type: console | ||
--- | ||
|
||
1. Create two objects in your environment, `x` and `y`. Assign `x` as a vector of numbers 1, 2, and 3. Assign `y` as a vector of numbers 4, 5, and 6. Once complete, check that both objects are visible in your RStudio environment. | ||
```{r} | ||
``` | ||
|
||
2. Clear your environment. Check that `x` and `y` are no longer in the environment by typing each letter in the console. What is the result? | ||
```{r} | ||
``` | ||
|
||
3. Check your R session info. Which version of R are you running? Which version of the `knitr` package are you running? Write these details below. | ||
```{r} | ||
``` | ||
|
||
- R version: | ||
- knitr version: | ||
|
||
**Bonus / Extra practice**: Create a vector `z` with the numbers 0 to 9. Set the seed for the R random number generator to 1234. Draw 5 numbers at random from `z` using the `sample()` function with `replace = TRUE`. Repeatedly run the code 3 times and note what you observe. | ||
```{r} | ||
``` | ||
|
||
**Bonus / Extra practice**: Run the `sample()` statement again, but this time without running the `set.seed()` line. What do you notice about the 5 numbers? | ||
```{r} | ||
``` |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
--- | ||
title: "Reproducibility Lab Key" | ||
output: html_document | ||
editor_options: | ||
chunk_output_type: console | ||
--- | ||
|
||
1. Create two objects in your environment, `x` and `y`. Assign `x` as a vector of numbers 1, 2, and 3. Assign `y` as a vector of numbers 4, 5, and 6. Once complete, check that both objects are visible in your RStudio environment. | ||
```{r} | ||
x <- c(1, 2, 3) | ||
y <- c(4, 5, 6) | ||
x | ||
y | ||
``` | ||
|
||
2. Clear your environment. Check that `x` and `y` are no longer in the environment by typing each letter in the console. What is the result? | ||
```{r} | ||
rm(list = ls()) | ||
``` | ||
|
||
3. Check your R session info. Which version of R are you running? Which version of the `knitr` package are you running? Write these details below. | ||
```{r} | ||
sessionInfo() | ||
``` | ||
|
||
- R version: | ||
- knitr version: | ||
|
||
**Bonus / Extra practice**: Create a vector `z` with the numbers 0 to 9. Set the seed for the R random number generator to 1234. Draw 5 numbers at random from `z` using the `sample()` function with `replace = TRUE`. Repeatedly run the code 3 times and note what you observe. | ||
```{r} | ||
z <- 0:9 | ||
set.seed(1234) | ||
sample(x = z, size = 5, replace = TRUE) | ||
``` | ||
|
||
**Bonus / Extra practice**: Run the `sample()` statement again, but this time without running the `set.seed()` line. What do you notice about the 5 numbers? | ||
```{r} | ||
sample(x = z, size = 5, replace = TRUE) | ||
``` |
471 changes: 471 additions & 0 deletions
471
modules/Reproducibility/lab/Reproducibility_Lab_Key.html
Large diffs are not rendered by default.
Oops, something went wrong.