Hello Everyone, So I am very new to R and I'm having some trouble. I basically have around 110 datasets each one made up of around 100 variables. I am trying to z-score the scores in each column but independently of each other ( each column independent of the other). The problem is that there are just too many variables in each dataset to compute individually. I figured there should be some type of loop that I can do in which it would scale the scores in each column and then move on to the next but I haven't been able to find anything about this. Can anyone help? Thanks so much! -RW -- View this message in context: http://r.789695.n4.nabble.com/scaling-variables-consecutively-and-independently-tp4710702.html Sent from the R help mailing list archive at Nabble.com.
David Winsemius
2015-Aug-03 19:42 UTC
[R] scaling variables consecutively and independently
On Aug 3, 2015, at 11:42 AM, Ram09 wrote:> Hello Everyone, > > So I am very new to R and I'm having some trouble. I basically have around > 110 datasets each one made up of around 100 variables. I am trying to > z-score the scores in each column but independently of each other ( each > column independent of the other). The problem is that there are just too > many variables in each dataset to compute individually. I figured there > should be some type of loop that I can do in which it would scale the scores > in each column and then move on to the next but I haven't been able to find > anything about this. Can anyone help? Thanks so much!Perhaps you are looking for the 'scale'-function? <deleted Nabble link> R-help at 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
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. 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? -RW -- View this message in context: http://r.789695.n4.nabble.com/scaling-variables-consecutively-and-independently-tp4710702p4710709.html Sent from the R help mailing list archive at Nabble.com.