I've read the previous posts and understand that my question is answered in different ways but I need to verify if I am on the right track please. I have a column in my data that ranges form 0.00012 to 1452. My goal is to rescale or normalize this column into a factor column ranging from 1 to 20 that are all discrete numbers then round to whole numbers. I have read this post Scale a series between two points and also this R- Normalizing certain columns from 0 to 1 with values equal to 0 that help but I can't get my final result. A sample of the data is as follows:
df_sample <- data.frame(performance_time= c(0.00012,0.12,3.45,12.65,5.8,145,782.45,1452,92.78,101.32))
Output of interest should be a rescaled column of C ranging from 1 to 20 and all discreet values. It would be great if I can perform it using dplyr.
Thank you for your help in advance.