On Aug 3, 2015, at 1:06 PM, Ram09 wrote:

> Yes, I've been using the scale function but I don't know how to write a line
> of code that will scale the scores in each variable independently of each
> other instead of as a whole.

You do not appear to be reading the help page for `scale`.

>  In other words, how can I get the scale
> function to standardize all the scores in one variable (column) then move on
> to the the next, so on and so forth for the whole dataset without having to
> tediously type out the same line of code for each variable? 

This is the first Line of text in the help page:

"'scale' is generic function whose default method centers and/or scales the 
columns of a numeric matrix."

If you do not want the result as a matrix then you can use lapply on a 
dataframe.

-- 
David.

R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

-- 

David Winsemius
Alameda, CA, USA

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to