alperyilmaz / dav-exercises

Exercise questions submitted by Data Analysis and Visualization with R course students at YTU
GNU General Public License v3.0
1 stars 2 forks source link

Banu's Diamond Ring (1305A035) #74

Open burcueren opened 6 years ago

burcueren commented 6 years ago

Please fill in the form to submit an exercise question. Please state the question under Question section. Please try to be as specific as possible when describing the problem. In hint chunk, you can provide a statement (which function to use, or which columns to join, etc.) or you can provide first 1-2 lines of expected result. Please refer to Github markdown table instructions if you need to include a table. In solution chunk please provide the code to solve the problem. Your solutions should be runnable in anybody's computer. Thus, please don't include file locations in your own computer while importing data. The data should be coming from a R package or from an online source.

Question

Banu goes to the jewellery to look for the diamond ring together with her fiancé. She is a very intelligent girl, so she does extensive research on diamonds before she comes to jewellery. The things that are important to her when choosing a diamond are the cut and the carat of the diamond. (of course the money is also very important for her fiancé :D)

By looking at the Banu diamond catalogs, the diamond cutter chooses diamonds that are not "fair" and carat value more than once.

a) Which diamonds can be taken with the lowest price according to the cutting quality ?

b) Using these features, let's get a colored graph based on the cut quality


*** Diamonds table can download with this URL
https://assets.datacamp.com/production/course_774/datasets/diamonds.RData

#a)

library(dplyr)
library(ggplot2)
library(bindr)

diamonds %>%
   group_by(cut) %>%
   filter(carat > 1 & cut!="Fair" ) %>%
   count(carat, cut, price) %>%
   summarise(min_price = min(price)) 

#b)

ggplot(diamonds, 
       aes(x = carat, y = price, col = cut)) + 
  geom_point(
    size = 3, alpha = 0.5, position = "dodge") 

resim

Originality

Please mark relevant information with x, (ex. [x])

Is this question

If you select Inspired or Paraphrased please provide the links in markdown format ( [link](http://example.com) ). Please provide all relevant links. You can refer to DataCamp course pages if you're inspired by them.

Difficulty Level

According to you, what is the level of difficulty of the question (note: this can be modified by instructor after submission)

Tags (optional)

Please provide comma separated list of dplyr verbs (e.g. summarize, left join) or concepts (e.g. text mining) that you think are relevant with question

Before submitting