Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

HW 1: Markdown

Stat 133, Spring 2023

Introduction

The purpose of this assignment is to work with an R Markdown (Rmd) file and practice writing content using markdown syntax, and a bit of math equations with latex syntax. Because you will be using R markdown files, aka Rmd files, throughout the rest of the course, the sooner you get familiar with this syntax, the better.

Important Note: This HW is the simplest and easiest assignment of the semester. Do not expect the rest of HW assignments to be like this one.

General Instructions

• Use an Rmd (R markdown) file, and name this file as hw1-first-last .Rmd, where first and last are your first and last names (e.g. hw1-gaston-sanchez .Rmd).

• You will have to knit your Rmd file into an HTML file.

• Submit both your Rmd and HTML files to bCourses (in the associated assignment submission).

• Please note that if you submit the incorrect files, you will receive no credit.

• Because this is the first HW, we are willing to make a one-time exception if you don’t submit both files.  However, please keep in mind that for future assignments, only

submitting one of the files will result in an automatic 20% deduction.

Here are some useful resources that you can look at to complete this assignment:

• Markdown reference: http://commonmark.org/help/

• RStudio has a very comprehensive R Markdown tutorial: http://rmarkdown.rstudio.co m/

• Mastering Markdown: https://guides.github.com/features/mastering-markdown/

• Adam Pritchard’s Markdown Cheatsheet: https://github.com/adam-p/markdown- here/wiki/Markdown-Cheatsheet

• RStudio cheatsheet: https://www.rstudio.com/wp-content/uploads/2015/02/rmarkd own-cheatsheet.pdf

1) Harry Potter Character

Visit Harry Potter Wiki https://harrypotter.fandom.com/wiki/Main_Page and choose one of the characters (e.g. Albus Dumbledore).

Use markdown syntax to write the following about the character you chose (do NOT use Albus Dumbledore for your submission):

• Include an image of the character.

•  Include one of the character’s quote using a markdown blockquote.

• Use a markdown table with two columns to include things like blood status, marital status, title, species, etc.

Here’s some sample content:

 

Figure 1: Albus Dumbledore

A quote by Albus Dumbledore:

“I had proven, as a very young man, that power was my weakness and temptation. I was safer at Hogwarts. I think I was a good teacher.”

Description

Value

Blood status

Half-blood

Marital status

Single

Title

Professor

Species

Human

More instructions in the next page

2) Cooking Recipe

Visit Alton Browns cooking recipes (https://altonbrown.com/cook/) and choose one recipe, e.g. All-American Beef Taco

https://altonbrown.com/recipes/all-american-beef-taco/

 

• Use different headers (e.g. #, ##, ###) to denote the name of the chosen meal, the list of ingredients, the cooking steps, etc.

• Include an image to show the appearance of the meal. You will need to either download an image of the recipe, or take a screenshot of it, and then use the local image file to be embedded in your document.

• Include a hyperlink of the recipe.

• Use an unordered list (of bullets) to list the ingredients.

• Use another unordered list to list any“special” kitchen tools that are needed.

• Write paragraphs to describe the steps of the recipe. Also, make sure to use markdown syntax to format text in italics, and bold when appropriate.

• Include a footnote. See the markdown cheatsheet (page 2) available in bCourses (folder Files) to learn how to insert footnotes.

More instructions in the next page

3) Euclidean Distance

Visit the wikipedia page for the Quadratic Equation:

https://en.wikipedia.org/wiki/Quadratic_equation

Use markdown syntax, as well as latex syntax for math symbols, to replicate the text of the definition for the Quadratic equation (see screenshot below):

To write all the three equations displayed in the screenshot—as well as the rest of math symbols scattered in the text—you will have to use latex syntax.  Here are a couple of resources about writing math symbols with Latex notation:

https://www.sharelatex.com/learn/Mathematical_expressions

https://en.wikibooks.org/wiki/LaTeX/Mathematics

If you feel the Quadratic equation is not enough, feel free to find other math equations and formulas to play with.

More instructions in the next page

4) Data Dictionary

Suppose we are interested in collecting data about water bottles sold by the American outdoor retailer REI. An example of this kind of item, shown in the image below, is the Hydro Flask water bottle with flex cap, 40 fl. oz.

https://www.rei.com/product/169850/hydro-flask-wide-mouth-vacuum-water-bottle-with- flex-cap-40-fl-oz

 

To be more specific, pretend we are interested in collecting data based on the technical specifications (e.g. “Best Use”, “Liquid Capacity”, “Dimensions”, etc)

Assume that you had to create a data dictionary for this hypothetical Water Bottles data set. Using markdown syntax, write content for an associated data dictionary (i.e. data codebook).

In other words, include:

• name of variables (as they would appear in the data file)

•  description of variables

•  units of measurement (if applicable)

•  recommended data types (e.g. logical, integer, double or real, character)

•  how missing values would be encoded

•  the source of the data

• mention any other details that you consider important for any user of the data