Exercise: Create Factors and a Data Frame
Use your learnings so far in trying to create factors and data-frame in R.
We'll cover the following
Assignment
Create a data frame containing at least one factor with three categories and three columns of made-up numeric data. With these requirements, the data frame should have at least four columns. Make sure the columns have meaningful names. There should be at least ten rows per category, meaning it should be at least 30 rows long.
We must try to code this before moving toward the solution.
How should we go about this?
As with anything in R, there are many different ways to create a data frame with these features. The basic idea here is to make a data frame with four columns, and one of those columns must be a factor with three categories.
Get hands-on with 1200+ tech skills courses.