R - How to turn a loop to a function in R -


Thank you for your reading. I often find that I need to apply the function to the slices of my data, and then tie the output. I usually create a loop for that purpose, but I'm sure I'm doing it wrong, and I should think about it in a different way. Can you please help me learn a better way to do this?

With thanks,

Adam

  rm (m); Meter = 0; # The loop will be produced for this variable (as standards.) Numeric (Level (factor (factor (s1 $ obs)) Go to the supervisor index for # {(Numerical level in NSSE (level (factor (subset (s) 1, Obs == nobs) $ session)) {Session session index ns1 = subset (s1, obs == Knox and session == NES and %%% c (1,2)); # interest DS = round Data fragment of (CLFDMC (ns1), 2); cs = round (cfdmc (ns1), 2) # data slice rw = cbind (nodes, nses, ds [2,3] ], DS [3,3], DS [2,3] -des [3,3], cs [1,3], cs [2,3], Knowles + nse / 10, ds [2,4], DS [3,4], CS [1,4], CS [2,4]) # Rows from output function = RBID (M, RW); # print (Paste ('obs:', Knowles, 'NSES : ', NSES,' clear D: ', DS [2,3],' red d ', ds [3,3]) # tied to the new line previous lines}} = data.fr (m [2] : Dim (m) [1],]) # Name of these results (m) = c ('obs',' ses', 'd_clear', 'ddrade', 'defrade', 'dcgg-1', 'dccg + 1 ',' Mark ',' c_ic Let us give the names of the variables  

plyr The package was specially designed to handle such data manipulation problems, see some documentation on the webpage:

> Round () syntax is not understood, but I believe that an equivalent plyr call

  library (plyr) ddply ( S1 ,. (Obs, session), Transcepts, DS = Round (CLDMC, 2), CS = Round (CFDMC, 2))  

I'm not absolutely Will ensure what you want. Your code is a little opaque.


Comments

Popular posts from this blog

Eclipse CDT variable colors in editor -

AJAX doesn't send POST query -

wpf - Custom Message Box Advice -