ComeçarComece de graça

Illogical weights

Removing abalones that had 0 mm heights was just the beginning. In this exercise, you will also investigate the component weights for the abalones. The wholeWeight is the total weight of the abalones in grams and includes the weight of the abalone meat as well as the shell. Thus, wholeWeight should be larger than shuckedWeight, visceraWeight and shellWeight.

As you saw in an earlier exercise there were a few pctShucked that were greater than 100% indicating cases where the shuckedWeight was greater than wholeWeight. In this exercise you will review and visualize these cases and then remove them from the dataset, abaloneKeep. abaloneKeep is loaded from the last exercise as well as the dplyr and ggplot2 packages.

Este exercício faz parte do curso

R For SAS Users

Ver curso

Instruções do exercício

  • Arrange abaloneKeep by pctShucked, pull pctShucked from abaloneKeep and view bottom 6 rows.
  • Make scatterplot of wholeWeight on x-axis and shuckedWeight on y-axis, add geom_abline() with intercept 0 and slope 1.
  • Keep cases where shuckedWeight is less than wholeWeight using filter() from dplyr package.

Exercício interativo prático

Experimente este exercício completando este código de exemplo.

# Sort abaloneKeep by pctShucked, view largest 6 pctShucked
abaloneKeep %>%
  ___ %>%
  ___ %>%
  ___

# Scatterplot of shuckedWeight by wholeWeight add y=x line
ggplot(___) +
  ___ +
  ___

# Keep cases where shuckedWeight is less than wholeWeight
abaloneKeep <- abaloneKeep %>%
  ___
Editar e executar o código