Skip to content

Commit b3b04c2

Browse files
committed
doc tweak about rgnorm() in SLiM-Extras
1 parent 149a6ad commit b3b04c2

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

EidosScribe/EidosHelpFunctions.rtf

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5137,6 +5137,7 @@ See
51375137
\f3\fs20 will be returned; if not,
51385138
\f1\fs18 F
51395139
\f3\fs20 will be returned (but at present, an error will result instead).\cf0 \
5140+
\pard\pardeftab543\li547\ri720\sb60\sa60\partightenfactor0
51405141
\cf2 If
51415142
\f1\fs18 compress
51425143
\f3\fs20 is
@@ -6267,8 +6268,9 @@ Named
62676268
\f1\fs18 c()
62686269
\f3\fs20 function (including the possibility of type promotion).\
62696270
Since this function can be hard to understand at first, here is an example:\
6271+
\pard\pardeftab397\li547\ri720\sb60\sa60\partightenfactor0
62706272

6271-
\f1\fs18 sapply(1:10, "if (applyValue % 2) applyValue ^ 2; else NULL;");\
6273+
\f1\fs18 \cf2 sapply(1:10, "if (applyValue % 2) applyValue ^ 2; else NULL;");\
62726274
\pard\pardeftab397\li547\ri720\sb60\sa60\partightenfactor0
62736275

62746276
\f3\fs20 \cf2 \kerning1\expnd0\expndtw0 This produces the output
@@ -6640,6 +6642,11 @@ If
66406642
\f3\fs20 had been supplied, but it is recommended to use
66416643
\f1\fs18 wait=T
66426644
\f3\fs20 instead to ensure that the command line is correctly assembled.\
6645+
\pard\pardeftab543\li547\ri720\sb60\sa60\partightenfactor0
6646+
\cf2 \kerning1\expnd0\expndtw0 There is an example at {\field{\*\fldinst{HYPERLINK "https://github.com/MesserLab/SLiM-Extras/blob/master/functions/rgnorm.slim"}}{\fldrslt \cf3 \ul \ulc3 https://github.com/MesserLab/SLiM-Extras/blob/master/functions/rgnorm.slim}} that demonstrates the use of
6647+
\f1\fs18 system()
6648+
\f3\fs20 , calling out to Python, to obtain draws from a generalized normal distribution (which is not supported intrinsically by Eidos). That example even includes internal buffering of a large number of draws, making it a reasonably efficient solution.\expnd0\expndtw0\kerning0
6649+
\
66436650
\pard\pardeftab397\li720\fi-446\ri720\sb180\sa60\partightenfactor0
66446651

66456652
\f1\fs18 \cf0 \kerning1\expnd0\expndtw0 (string$)time(void)\

QtSLiM/help/EidosHelpFunctions.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<meta http-equiv="Content-Style-Type" content="text/css">
66
<title></title>
77
<meta name="Generator" content="Cocoa HTML Writer">
8-
<meta name="CocoaVersion" content="2299.5">
8+
<meta name="CocoaVersion" content="2299.77">
99
<style type="text/css">
1010
p.p1 {margin: 18.0px 0.0px 3.0px 0.0px; font: 11.0px Optima}
1111
p.p2 {margin: 9.0px 0.0px 3.0px 36.0px; text-indent: -22.3px; font: 9.0px Menlo}
@@ -659,6 +659,7 @@
659659
<p class="p14">system("(wc -l | sed 's/ //g')", input=c('foo', 'bar', 'baz'));</p>
660660
<p class="p3">will supply the input lines to <span class="s2">wc</span> courtesy of the subshell started for the <span class="s2">()</span> operator.<span class="Apple-converted-space">  </span>If this strategy doesn’t work for the command line you want to execute, you can always write a temporary file yourself using <span class="s2">writeFile()</span> or <span class="s2">writeTempFile()</span> and redirect that file to standard input in <span class="s2">command</span> with <span class="s2">&lt;</span><span class="s3">.</span></p>
661661
<p class="p5"><span class="s5">If </span><span class="s6">wait</span><span class="s5"> is </span><span class="s6">T</span><span class="s5"> (the default), </span><span class="s6">system()</span><span class="s5"> will wait for the command to finish, and return the output generated as a </span><span class="s6">string</span><span class="s5"> vector, as described above.<span class="Apple-converted-space">  </span>If </span><span class="s6">wait</span><span class="s5"> is </span><span class="s6">F</span><span class="s5">, </span><span class="s6">system()</span><span class="s5"> will instead append </span><span class="s6">" &amp;"</span><span class="s5"> to the end of the command line to request that it be run in the background, and it will not collect and return the output from the command; instead it will return </span><span class="s6">string(0)</span><span class="s5"> immediately.<span class="Apple-converted-space">  </span>If the output from the command is needed, it could be redirected to a file, and that file could be checked periodically in Eidos for some indication that the command had completed; if output is not redirected to a file, it may appear in SLiM’s output stream.<span class="Apple-converted-space">  </span>If the final command line executed by </span><span class="s6">system()</span><span class="s5"> ends in </span><span class="s6">" &amp;"</span><span class="s5">, the behavior of </span><span class="s6">system()</span><span class="s5"> should be just as if </span><span class="s6">wait=T</span><span class="s5"> had been supplied, but it is recommended to use </span><span class="s6">wait=T</span><span class="s5"> instead to ensure that the command line is correctly assembled.</span></p>
662+
<p class="p5">There is an example at <a href="https://github.com/MesserLab/SLiM-Extras/blob/master/functions/rgnorm.slim"><span class="s20">https://github.com/MesserLab/SLiM-Extras/blob/master/functions/rgnorm.slim</span></a> that demonstrates the use of <span class="s2">system()</span>, calling out to Python, to obtain draws from a generalized normal distribution (which is not supported intrinsically by Eidos).<span class="Apple-converted-space">  </span>That example even includes internal buffering of a large number of draws, making it a reasonably efficient solution.</p>
662663
<p class="p2">(string$)time(void)</p>
663664
<p class="p3">Returns a <b>standard time string</b> for the current time in the local time of the executing machine.<span class="Apple-converted-space">  </span>The format is <span class="s2">%H:%M:%S</span> (hour in two digits, then minute in two digits, then seconds in two digits, zero-padded and separated by dashes) regardless of the localization of the executing machine, for predictability and consistency.<span class="Apple-converted-space">  </span>The 24-hour clock time is used (i.e., no AM/PM).</p>
664665
<p class="p4"><span class="s5">(float$)usage(</span>[ls$ type = "rss"]<span class="s5">)</span></p>

0 commit comments

Comments
 (0)