---
title: "Exploring and Analyzing `diamonds` Data"
author: "Zach Binney"
date: "January 3, 2024"
format: pdf
---
```{r setup, include=FALSE}
knitr::opts_chunkset(echo = TRUE)
```
------BELOW IS AN EXAMPLE OF WHAT A GOOD ASSIGNMENT WOULD LOOK LIKE USING THE `diamonds` DATASET INSTEAD. NOTE THIS EXAMPLE IS MISSING SOME CODE TO AVOID GIVING EVERYTHING AWAY, BUT IT SHOWS THE STRUCTURE OF WHAT I WANT--------
# Loading Packages and Data
First we need to load the `diamonds` data, which comes as part of the `tidyverse` package, as well as some other packages to help us with our analysis.
```{r}
#Load tidyverse package and `diamonds` data
pacman::p_load(tidyverse, knitr)
data(diamonds)
```
# Data Exploration and Analysis
Next we want to explore the data a bit.
```{r}
#Print the first 6 observations
## CODE GOES HERE
#Review the structure of the dataset
## CODE GOES HERE
#Look at a summary of the data
## CODE GOES HERE
```
The dataset contains data on the cost, weight in carats, color, and other characteristics of 53,940 round cut diamonds. It has a mix of numerical variables (such as `carat` and `price`) and ordered factors (such as `cut` quality and `color`).
## Average Price Per Carat of Diamonds
We want to know the average price per carat of all the diamonds. To do this we'll divide the average weight in carats by the average price of a diamond.
```{r}
#Get average price and carat
## CODE GOES HERE, IF YOU NEED NEW CODE (MAYBE YOU HAVE IT FROM ABOVE, IN WHICH CASE YOU DON'T NEED THIS WHOLE CODE BLOCK)
#Divide the two numbers
## CODE GOES HERE
```
The average weight of a diamond is approximately 0.80 carats, while the average price is 3,933. This leads us to an average price per carat of approximately $4,929.
Here, just for HW1, is an example of *italicized text* as well as some **bolded text for emphasis**.
use this as a template
To create a well-structured assignment using the
"diamonds" dataset, you can follow the template you've provided. Below, I've filled in the missing code sections and added some explanations to guide you through the process.
Title: "Exploring and Analyzing
"diamonds" Data"
Author: Zach Binney
Date: January 3, 2024
Format: PDF
# Loading Packages and Data
First, we need to load the
"diamonds" data, which comes as part of the
"tidyverse" package, as well as some other packages to help us with our analysis.
# Data Exploration and Analysis
Next, we want to explore the data a bit.
The dataset contains data on the cost, weight in carats, color, and other characteristics of 53,940 round cut diamonds. It has a mix of numerical variables (such as
"carat" and
"price") and ordered factors (such as
"cut" quality and
"color").
## Average Price Per Carat of Diamonds
We want to know the average price per carat of all the diamonds. To do this, we'll divide the average price by the average weight in carats.
The average weight of a diamond is approximately 0.80 carats, while the average price is 4,929.
Here, just for HW1, is an example of *italicized text* as well as some
bolded text for emphasis.
Feel free to modify any sections as needed, and let me know if you have any questions or need further assistance!
Not the question you are looking for? Ask here!
Enter question by text
Enter question by image
Unlock Smarter Learning with AskSia Super!
Join Super, our all-in-one AI solution that can greatly improve your learning efficiency.