Adapting string variables to a standard
You are almost done with the basics of data cleaning. At this point in the process, you have summarized, fixed, and converted your input data. This means that it is time for you to accomplish the fourth SFCA step, adapting your data to a standard.
The term standard has many possible meanings. It may be that an R package will set a standard for you. In other cases, you may wish to establish one. For instance, notice in the previous data view that the sources
variable is a character data type. You will see that it contains the advertising source where the customer learned about bike sharing. Leaving this as a character data type seems reasonable, but R cannot group character items to summarize them in analysis.
Your implied standard is that sources
should be a categorical variable. What might happen if you use the as.factor(bike$sources)
function? This will convert the data, but before you do that, you should consider a couple of questions:
How many unique...