Skip to content

Commit 5acfc79

Browse files
authored
Merge pull request #3 from MonashBioinformaticsPlatform/day2
Image and code block fixes
2 parents a32d2b2 + f126dbf commit 5acfc79

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

09-r-environment-setup.Rmd

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ For today's session, we will be using the [R](https://www.r-project.org/) statis
44

55
This will create a central place to write code, comments, run code, view and save graphics.
66

7-
![RStudio logo](images/rstudio_logo.png)
7+
![](images/rstudio_logo.png)
88

99
<p>&nbsp;</p> <!-- insert blank line -->
1010

@@ -19,7 +19,7 @@ RStudio with all the required R packages for today's activities are installed on
1919

2020
When RStudio opens, you will see empty `Console`, `History` and `Plots` panes.
2121

22-
![RStudio logo](images/rstudio-default-open.png)
22+
![](images/rstudio-default-open.png){ width=100% }
2323

2424
<p>&nbsp;</p> <!-- insert blank line -->
2525

@@ -33,7 +33,7 @@ The `Console` contains the command prompt (`>`) which is where R commands are en
3333

3434
&#x27A4; Test this out by copy pasting or typing the below command into your console then pressing `enter` key. This will print the path of your current working directory:
3535

36-
```{r getwd}
36+
```{r getwd, echo=TRUE, eval=FALSE}
3737
getwd()
3838
```
3939

@@ -53,11 +53,12 @@ Let's put something in there:
5353

5454
&#x27A4; Create an R variable called `name` and fill it with your name, then print it with the `cat` command:
5555

56-
```{r my name}
56+
```{r my name, echo=TRUE, eval=FALSE}
5757
name <- 'Cali'
5858
cat(name)
5959
```
6060

61+
6162
Note that the object `name` is now listed in the environment.
6263

6364
<p>&nbsp;</p> <!-- insert blank line -->
@@ -66,7 +67,7 @@ Now let's see the `plots` pane in action by creating a simple dummy barplot:
6667

6768
&#x27A4; Copy paste the below code into your console then press enter:
6869

69-
```{r plot}
70+
```{r plot, echo=TRUE, eval=FALSE}
7071
values <- c(5, 10, 15)
7172
labels <- c("A", "B", "C")
7273
barplot(values, names.arg = labels)
@@ -90,7 +91,7 @@ Using notebooks in RStudio is a great way to save your code and comments, as wel
9091

9192
&#x27A4; Open a new R notebook from the RStudio toolbar by selecting `File` &rarr; `New file` &rarr; `R Notebook`:
9293

93-
![RStudio logo](images/rstudio-new-notebook.png)
94+
![](images/rstudio-new-notebook.png){ width=100% }
9495

9596

9697
The new notebook opens in the `Editor` pane. It has a placeholder title and basic starting instructions.
@@ -109,7 +110,7 @@ New code chunks can be added with the shortcut `ctrl + alt + i` or via the toolb
109110

110111
<p>&nbsp;</p> <!-- insert blank line -->
111112

112-
&#x27A4; Run the demo code chunk to plot `cars`
113+
&#x27A4; Run the demo code chunk that was included in the new notebook to plot `cars`
113114

114115
Note that the plot dispalys *inside* the notebook, rather than within the plot pane as we saw earlier.
115116

@@ -119,7 +120,7 @@ Note that the plot dispalys *inside* the notebook, rather than within the plot p
119120
&#x27A4; Add a new code chunk by entering `ctrl + alt + i` and label it `barplot`. Then copy the dummy barplot code from earlier into the code chunk and run it
120121

121122

122-
```{r barplot}
123+
```{r barplot, echo=TRUE, eval=FALSE}
123124
values <- c(5, 10, 15)
124125
labels <- c("A", "B", "C")
125126
barplot(values, names.arg = labels)
@@ -204,4 +205,6 @@ Note that the code chunk label also contains the text `include=FALSE`. This prev
204205

205206
Please let us know if you have any errors loading the packages :raised_hand:
206207

207-
Don't be alarmed that the output is <span style="color: red;">red</span>! :slightly_smiling_face:
208+
Don't be alarmed that the output is <span style="color: red;">red</span>! :slightly_smiling_face:
209+
210+
Now here is a unicode smiling face: `r cat("\U0001F603")`

0 commit comments

Comments
 (0)