Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Code:
Output:
[1] 959 10
Insight:
diamonds1000512I %>% filter(color == 'D') %>% as.data.frame() ->
diamonds1000512ID
diamonds1000512I dataset has been passed to filter function
filter() function find rows/cases where conditions are true
in filter() function we have passed the condition that is color of
diamonds should be equal to “D”
This function will get the rows or cases having color equal to “D”.
Output is than converted to data frame
# dim(diamonds1000512ID) used to find the dimension of diamonds1000512ID
CONCLUSION
o Getting the data set with color of diamonds should be equal to “D”
o New dataset diamonds1000512ID has been formed having color equal to “D”.
o Number of diamonds with color equal to “D” are 959 from 6921
Code:
Output:
Insight:
Code:
Output:
Insight:
Code:
Output:
[1] 21 10
Insight:
diamonds1000512ID %>% filter(clarity == 'VVS1') %>% as.data.frame() ->
diamonds1000512IDVVS1
diamonds1000512ID dataset has been passed to filter function
filter() function find rows/cases where conditions are true
in filter() function we have passed the condition that is clarity of
diamonds should be equal to “VVS1”
This function will get the rows or cases having clarity equal to
“VVS1”.
Output is than converted to data frame
# dim(diamonds1000512IDVVS1) used to find the dimension of
diamonds1000512IDVVS1
CONCLUSION
o Getting the data set with clarity VVS1
o New dataset diamonds1000512IDVVS1 has been formed having clarity equal
to “VVS”.
o Number of diamonds with clarity equal to “VVS1”. 21 from 959
Code:
Output:
Insight: