In this exercise you will practice marking up some plain text using R markdown syntax.
Create a new RStudio project called ‘BI5302’ in RStudio. Now create a new R markdown document and save it with an appropriate file name on your computer (perhaps squid_analysis.Rmd
). Make sure you fill out the ‘Title’ and ‘Author’ information and set the output option to HTML when you create your document. Next, copy and paste the text in the box below into your R markdown document.
Sampling and data description
These data were originally collected as part of a study published in
Aquatic Living Resources (Smith et al. 2005). The aim of the study was
to investigate the seasonal patterns of investment in somatic and
reproductive tissues in the long finned squid Loligo forbesi caught
in Scottish waters. Squid were caught monthly from December
1989 - July 1991 (month and year variables). After capture, each
squid was given a unique specimen code (specimen variable) and
the following variables measured:
body weight - weight variable
sex - sex variable (only female squid are included here)
individual dorsal mantle length -DML variable
mantle weight measured without internal organs - eviscerate.weight variable
gonads weight - ovary.weight variable
nidamental gland weight - nid.weight variable.names
nidamental gland length - nid.length variable
digestive gland weight - dig.weight variable
Each individual was also assigned a categorical measure of maturity
(maturity.stage variable) ranging from 1 to 5 with 1 = immature, 5 = mature.
Some interesting background information on squid morphology can be
found here (https://en.wikipedia.org/wiki/Loligo_forbesii) and the following image provides a useful summary of squid anatomy
You will also need to download this image so you can include it in your final rendered document. Create a subdirectory called images
in your RStudio project root directory and save the image file there (right click and then choose save image as...
or similar).
Now mark it up using R markdown syntax so your rendered output document looks like this.
Sampling and data description
These data were originally collected as part of a study published in Aquatic Living Resources (Smith et al., 2005). The aim of the study was to investigate the seasonal patterns of investment in somatic and reproductive tissues in the long finned squid Loligo forbesi caught in Scottish waters. Squid were caught monthly from December 1989 - July 1991 (month and year variables). After capture, each squid was given a unique specimen code (specimen variable) and the following variables measured:
- weight variable - body weight (g)
- sex variable - sex (only female squid are included here)
- DML variable - individual dorsal mantle length (mm)
- eviscerate.weight variable - mantle weight measured without internal organs (g)
- ovary.weight variable - gonad weight (g)
- nid.weight variable - nidamental gland weight (g)
- nid.length variable - nidamental gland length (g)
- dig.weight variable - digestive gland weight (g)
Each individual was also assigned a categorical measure of maturity (maturity.stage variable) ranging from 1 to 5 with 1 = immature, 5 = mature.
Some interesting background information on squid morphology can be found here and the following image provides a useful summary of squid anatomy.
Once you’re happy with marking up your text, save your R markdown document and then knit your R markdown document to a HTML file. Open this file in your web browser by clicking on the squid_analysis.html file in the ‘Files’ pane in RStudio and select the Open in browser option. Check the formatting is correct. You could also try knitting to a pdf document.
You can find the solution below (click on the ‘code’ button on the right)
## Sampling and data description
in Aquatic Living Resources (Smith *et al*.,
These data were originally collected as part of a study published 2005). The aim of the study was to investigate the seasonal patterns of investment in somatic and
in the long finned squid *Loligo forbesi* caught in Scottish waters. Squid
reproductive tissues 1989 - July 1991 (**month** and **year variables**). After capture,
were caught monthly from December code (**specimen variable**) and the following variables measured:
each squid was given a unique specimen
- **weight variable** - body weight (g)
- **sex variable** - sex (only female squid are included here)
- **DML variable** - individual dorsal mantle length (mm)
- **eviscerate.weight variable** - mantle weight measured without internal organs (g)
- **ovary.weight variable** - gonad weight (g)
- **nid.weight variable** - nidamental gland weight (g)
- **nid.length variable** - nidamental gland length (g)
- **dig.weight variable** - digestive gland weight (g)
maturity (**maturity.stage variable**) ranging from 1 to 5 with 1 = immature, 5 = mature.
Each individual was also assigned a categorical measure of
://en.wikipedia.org/wiki/Loligo_forbesii) and the following image provides a useful summary of squid anatomy.
Some interesting background information on squid morphology can be found [here](https![squid anatomy](images/squid_anatomy.jpg)