Object type conversion
Some object types can be converted from one class to another class. For this exercise you will select and convert variables in the abaloneMod dataset from one class type to another. The previous abaloneMod dataset and dplyr package is also loaded for you.
Este ejercicio forma parte del curso
R For SAS Users
Instrucciones del ejercicio
- Convert
adultto numeric usingas.numeric(), then confirm its class type. - Select the three abalone dimensions:
length,diameterandheightfromabaloneModand save them in a new object calledabalonedim. - Convert
abalonedimto a matrix and confirm its class type.
Ejercicio interactivo práctico
Prueba este ejercicio y completa el código de muestra.
# Convert adult to numeric then confirm class type
abaloneMod %>%
___ %>%
___ %>%
___
# Select three dimensions, save as abalonedim
abalonedim <- ___ %>%
___
# Convert abalonedim to a matrix and confirm class type
abalonedim %>%
___ %>%
___