# Provide an R program that uses the ”diamond.xlsx” data to do the following:

I’m trying to study for my Computer Science course and I need some help to understand this question.

1. Read the data into a R dataframe.

2. Create two new variables:

(a) One that holds the price of the diamond in euros (\$1 = AC0.92).

(b) One that splits the diamonds according to their size as small = < .6 carats, medium=between .6 and 1 carats, and large = > 1 carat.

3. Create a pie chart that shows the frequency of the different size categories. Make sure the graph has appropriate title, labels, and font size, and make sure the order of the categories in the graph makes sense.

4. Create a vertical barchart that shows the frequency of the different cut categories. Make sure the graph has appropriate title, labels, and font size, and make sure the order of the categories in the graph makes sense. Display the frequency of each category on the top of corresponding bar.

5. Create a visual display that displays the frequency of the different cuts within the three size classes you created in the previous step. Make sure the graph has appropriate title, labels, and font size, and make sure the order of the categories in the graph makes sense.

6. Find the min, max, mean, median, sd, and IQR of the depths of the diamonds. Make sure to present the numbers with only 2 decimal digits.

7. Find the mean and median of the depths for each of the different diamond cuts in the sample. Make sure to present the numbers with only 2 decimal digits.

8. Create a graphical display that compares the prices of the diamonds in \$ across the different cuts. Make sure the graph has appropriate title, labels, and font size, and make sure the order of the categories in the graph makes sense.

9. Create a visual display that helps you figure out if there is a relationship between the size of a diamond (carats) and its price in \$. Make sure the graph has appropriate title, labels, and font size, and make sure the order of the categories in the graph makes sense.

”diamond.xlsx” Descriptions:

• price: price in US dollars

• carat: weight/size of the diamond

• cut: quality of the cut (Fair, Good, Very Good, Premium, Ideal) • color: diamond colour, from J (worst) to D (best)

• clarity: a measurement of how clear the diamond is (I1 (worst), SI2, SI1, VS2, VS1, VVS2, VVS1, IF (best))

• x: length in mm (010.74)

• y: width in mm (058.9)

• z: depth in mm (031.8)

• depth: total depth percentage = z / mean(x, y) = 2 * z / (x + y) (4379)

• table: width of top of diamond relative to widest point (4395)