Standardize the dataset

In order to analyze the data I need to standardize it by subtracting mean and dividing by standard deviation. I need to standardize the dataset using for() loop. I want to know how to do this using R software.

Hi,
Generally, the scale() function can already be used for what you are doing, so there might not be a need to use a for loop.
However, without providing some information about your data and some of your own attempts to solve the problem, it is hard to give you any useful help. Have a look at this link: FAQ: How to do a minimal reproducible example ( reprex ) for beginners to read how you could give us this information.

In the meantime, you could have a look at the introduction to for loops in R for Data Science (chapter 21), there you can read a bit about for loops and some alternantives in R.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.