diff --git a/blog/2024/08/31/ppswor.html b/blog/2024/08/31/ppswor.html index 645987144..e0e1c0cf6 100644 --- a/blog/2024/08/31/ppswor.html +++ b/blog/2024/08/31/ppswor.html @@ -206,8 +206,9 @@

Not proportional to w

}) s <- ifelse(replace, 'with replacement', 'without replacement') - m <- ifelse(identical(FUN, sample), "R's native `sample()` function.", - "experimental function based on Brewer (1975).") + m <- case_when(identical(FUN, sample) ~ "R's native `sample()` function.", + identical(FUN, sample_unequal) ~ "experimental function based on Brewer (1975).", + identical(FUN, sample_brewer) ~ "Brewer (1975) as implemented by Tillé/Matei.") p <- tibble( original = prob, diff --git a/feed.r.xml b/feed.r.xml index 46ed625c4..eeb948f9a 100644 --- a/feed.r.xml +++ b/feed.r.xml @@ -54,8 +54,9 @@ </span><span class="p">})</span><span class="w"> </span><span class="n">s</span><span class="w"> </span><span class="o">&lt;-</span><span class="w"> </span><span class="n">ifelse</span><span class="p">(</span><span class="n">replace</span><span class="p">,</span><span class="w"> </span><span class="s1">'with replacement'</span><span class="p">,</span><span class="w"> </span><span class="s1">'without replacement'</span><span class="p">)</span><span class="w"> - </span><span class="n">m</span><span class="w"> </span><span class="o">&lt;-</span><span class="w"> </span><span class="n">ifelse</span><span class="p">(</span><span class="n">identical</span><span class="p">(</span><span class="n">FUN</span><span class="p">,</span><span class="w"> </span><span class="n">sample</span><span class="p">),</span><span class="w"> </span><span class="s2">"R's native `sample()` function."</span><span class="p">,</span><span class="w"> - </span><span class="s2">"experimental function based on Brewer (1975)."</span><span class="p">)</span><span class="w"> + </span><span class="n">m</span><span class="w"> </span><span class="o">&lt;-</span><span class="w"> </span><span class="n">case_when</span><span class="p">(</span><span class="n">identical</span><span class="p">(</span><span class="n">FUN</span><span class="p">,</span><span class="w"> </span><span class="n">sample</span><span class="p">)</span><span class="w"> </span><span class="o">~</span><span class="w"> </span><span class="s2">"R's native `sample()` function."</span><span class="p">,</span><span class="w"> + </span><span class="n">identical</span><span class="p">(</span><span class="n">FUN</span><span class="p">,</span><span class="w"> </span><span class="n">sample_unequal</span><span class="p">)</span><span class="w"> </span><span class="o">~</span><span class="w"> </span><span class="s2">"experimental function based on Brewer (1975)."</span><span class="p">,</span><span class="w"> + </span><span class="n">identical</span><span class="p">(</span><span class="n">FUN</span><span class="p">,</span><span class="w"> </span><span class="n">sample_brewer</span><span class="p">)</span><span class="w"> </span><span class="o">~</span><span class="w"> </span><span class="s2">"Brewer (1975) as implemented by Tillé/Matei."</span><span class="p">)</span><span class="w"> </span><span class="n">p</span><span class="w"> </span><span class="o">&lt;-</span><span class="w"> </span><span class="n">tibble</span><span class="p">(</span><span class="w"> </span><span class="n">original</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">prob</span><span class="p">,</span><span class="w">