R Basics-5 - Coding-Categorical to Numeric Variable (Hands On) - ClassiCoder

Conversion of Variables

Perform the following tasks:

1. Create a factor vector v1 using 10 random numbers without decimals.

2. Convert the factor vector to numeric vector v2.

3. Compare v1 and v2 element-wise. Store the comparison values (true or false) in a vector, and display them.


Categorical-to-Numeric-Variable-in-R-Basic


Categorical-to-Numeric-Variable-in-R-Basic-Solution