How to apply one_hot manually

one_hot() is not a base R function so I think you should specify which package are you referring to, ideally, you should present your issue as a REPRoducible EXample (reprex).
Please take a look at our homework policy to learn how to properly ask homework-inspired questions here.