1 Writing formatted text using R markdown

  1. Use R markdown to create write the following formatted text:


  1. Create the following ordered list:

  1. Write the following equation:

  1. Create the following table:

  1. Create a level 2 heading called “Countries by population”.

2 Including and executing R code chunks

  1. Insert a code chunk that computes \(1 + \frac{1}{2} + \frac{1}{2^2} + \frac{1}{2^3} + \frac{1}{2^4}\).

3 Working with the penguins dataset

  1. Insert a code chunk to load the palmerpenguins and ggplot2 libraries and run it.

  2. Insert a code chunk to preview the penguins dataset (see item #2 in Section “Working with the penguins dataset” of Module 1 Study Guide A) and run it. How many categorical/qualitative/factor variables and how many numerical/quantitative variables does this dataset have? How many penguins does the dataset have?

  3. Insert a code chunk to create a scatterplot of flipper length vs. body mass, putting the former on the y- and the latter on the x-axis.

  4. Change the plot above so that the sex of each penguin is shown in color.

  5. Add separate trendlines (straight) for males and females.

  6. Add proper labels with units to the x-axis, y-axis, and the color legend, as well as an informative title.

  7. What can we conclude about the relationship between flipper length and body mass and how it depends on sex?


4 Working with R variables

  1. An approximate formula for determining the moles of double-stranded DNA (dsDNA) in a certain mass (in grams) is \(m = \frac{g}{w}\), where \(m\) is the number of moles, \(g\) is the mass in grams, and \(w\) is the molecular weight (in Daltons) of the dsDNA molecule. The approximate molecular weight of a single nucleotide is 650 Da. Therefore, the molecular weight \(w\) of a dsDNA molecule of length \(l\) is \(w = 650 \times l\). Use R variables and expressions to compute the moles in 60ng of a 1000bp long dsDNA molecule. Use scientific notation to assign the mass in grams and length to variables g and l respectively. Use l and the formula for the molecular weight \(w\) above to compute the molecular weight and assign it to a variable w. Use the variables g and w and the formula for the moles \(m\) above to compute the moles and assign it to a variable m. Print out the value of m.

  2. Make a copy of your code below. Determine the number of molecules \(n\) from the moles \(m\) by multiplying with the Avogadro’s constant (\(6.023 \times 10^23\)) and assigning the result to a variable n. Print out n’s value.

  3. Make a copy of the code below. The length of the human genome is 3.2 billion bp. Change the code to determine the number of human genomes in 60pg of dsDNA.


End of HW