very cool coding style [Regulatives / Guidelines]

posted by ElMaestro  – Denmark, 2012-06-16 21:12 (5113 d 05:56 ago) – Posting: # 8762
Views: 15,174

Hi HS,

while (sum(x) != 0) x <- sign(rnorm(size))


a little off topic, but it took me some time to get my head around this code line of yours. Now that I (think I) get it, I must say this is an incredibly elegant way of achieveing a lot with minimum coding. It completely permutes equal numbers of TR and RT (or -1's and 1's). Very, very elegant style!!! Me likey! :cool::cool::cool:

Pass or fail!
ElMaestro

Complete thread:

UA Flag
Activity
 Admin contact
23,654 posts in 4,992 threads, 1,571 registered users;
141 visitors (0 registered, 141 guests [including 34 identified bots]).
Forum time: 03:08 CEST (Europe/Vienna)

Scientists often have a naïve faith that
if only they could discover enough facts about a problem,
these facts would somehow arrange themselves
in a compelling and true solution.    Theodosius Dobzhansky

The Bioequivalence and Bioavailability Forum is hosted by
BEBAC Ing. Helmut Schütz
HTML5