Creating New Numeric Variable based on a mathematical expression

@shoaibraee Yes it would seem that that column is not numeric. I suggest to use class() to ensure the class is numeric right before this case_when() error.

At this point, I will be able to help you if you can share a small piece of your data and the code leading to this problem. See this post and this video to help you.

In brief: Take your dataset right before this problem occurs. Keep only the top 10 rows using head(10) and only the relevant columns for the error (using select()) and give it a name such as test_data. Then run dpasta(test_data) from the {datapasta} package. This will provide code that you can paste here so that we can help fix your problem.

The next step is to install/load the {reprex} package. As explained in the video, highlight your code from the test_data object to the point of the error, and run the reprex() function. Paste the result into this thread.

Best of luck! Let us know if anything can be clarified.

2 Likes