ComenzarEmpieza gratis

Check dimension measurements

So far you have removed 2 cases with 0mm abalone heights which were measured incorrectly. You also removed 4 cases where shuckedWeight was larger than wholeWeight which is illogical probably due to recording errors. The abaloneKeep dataset loaded for this exercise now only has 4177 - 2 - 4 = 4171 cases.

Additionally, the relationship of the dimensional measurements also need to be reviewed. The length of the abalones (in mm) was defined to be the longest shell measurement. So, length should always be greater than height or diameter. Now, you will check this condition using a scatterplot with a Y=X reference line. You will then remove any cases that fail this length condition.

The abaloneKeep dataset, dplyr and ggplot2 packages are also loaded for you.

Este ejercicio forma parte del curso

R For SAS Users

Ver curso

Instrucciones del ejercicio

  • Make a scatterplot of length on x-axis and height on y-axis and add reference line Y=X with intercept 0 and slope 1.
  • Make a scatterplot of length on x-axis and diameter on y-axis and add reference line Y=X with intercept 0 and slope 1.
  • Update abaloneKeep to keep abalones with length greater than both height and diameter.

Ejercicio interactivo práctico

Prueba este ejercicio y completa el código de muestra.

# Make scatterplot of height by length add y=x line
ggplot(___) +
  ___ + 
  ___

# Make scatterplot of diameter by length add y=x line
ggplot(___) +
  ___ + 
  ___

# Keep abalones with length > both height and diameter
abaloneKeep <- abaloneKeep %>%
  filter((___) & (___))
Editar y ejecutar código