How to rescale value in a loop based

See the FAQ for how to put you question in a form that makes it easier to attract answers, beginning with avoiding having to create the data frame.