Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
OliviaLorente-Casalini authored Apr 5, 2024
1 parent bfab80e commit 84fa3b1
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 35 deletions.
74 changes: 39 additions & 35 deletions stringr.html
Original file line number Diff line number Diff line change
Expand Up @@ -384,41 +384,45 @@ <h3 class="anchored" data-anchor-id="str_match"><code>str_match()</code></h3>
<span id="cb12-9"><a href="#cb12-9" aria-hidden="true" tabindex="-1"></a><span class="co">#&gt; [7,] NA </span></span>
<span id="cb12-10"><a href="#cb12-10" aria-hidden="true" tabindex="-1"></a><span class="co">#&gt; [8,] "son"</span></span>
<span id="cb12-11"><a href="#cb12-11" aria-hidden="true" tabindex="-1"></a><span class="co">#&gt; [9,] NA</span></span>
<span id="cb12-12"><a href="#cb12-12" aria-hidden="true" tabindex="-1"></a><span class="fu">str_match</span>(versos, <span class="st">"(son) (buenos|mejores)"</span>)</span>
<span id="cb12-13"><a href="#cb12-13" aria-hidden="true" tabindex="-1"></a><span class="co">#&gt; [,1] [,2] [,3] </span></span>
<span id="cb12-14"><a href="#cb12-14" aria-hidden="true" tabindex="-1"></a><span class="co">#&gt; [1,] NA NA NA </span></span>
<span id="cb12-15"><a href="#cb12-15" aria-hidden="true" tabindex="-1"></a><span class="co">#&gt; [2,] "son buenos" "son" "buenos" </span></span>
<span id="cb12-16"><a href="#cb12-16" aria-hidden="true" tabindex="-1"></a><span class="co">#&gt; [3,] NA NA NA </span></span>
<span id="cb12-17"><a href="#cb12-17" aria-hidden="true" tabindex="-1"></a><span class="co">#&gt; [4,] "son mejores" "son" "mejores"</span></span>
<span id="cb12-18"><a href="#cb12-18" aria-hidden="true" tabindex="-1"></a><span class="co">#&gt; [5,] NA NA NA </span></span>
<span id="cb12-19"><a href="#cb12-19" aria-hidden="true" tabindex="-1"></a><span class="co">#&gt; [6,] NA NA NA </span></span>
<span id="cb12-20"><a href="#cb12-20" aria-hidden="true" tabindex="-1"></a><span class="co">#&gt; [7,] NA NA NA </span></span>
<span id="cb12-21"><a href="#cb12-21" aria-hidden="true" tabindex="-1"></a><span class="co">#&gt; [8,] NA NA NA </span></span>
<span id="cb12-22"><a href="#cb12-22" aria-hidden="true" tabindex="-1"></a><span class="co">#&gt; [9,] NA NA NA</span></span>
<span id="cb12-23"><a href="#cb12-23" aria-hidden="true" tabindex="-1"></a><span class="fu">str_match</span>(versos, <span class="st">"(que|son) ([^ ]+)"</span>)</span>
<span id="cb12-24"><a href="#cb12-24" aria-hidden="true" tabindex="-1"></a><span class="co">#&gt; [,1] [,2] [,3] </span></span>
<span id="cb12-25"><a href="#cb12-25" aria-hidden="true" tabindex="-1"></a><span class="co">#&gt; [1,] "que luchan" "que" "luchan" </span></span>
<span id="cb12-26"><a href="#cb12-26" aria-hidden="true" tabindex="-1"></a><span class="co">#&gt; [2,] "son buenos" "son" "buenos" </span></span>
<span id="cb12-27"><a href="#cb12-27" aria-hidden="true" tabindex="-1"></a><span class="co">#&gt; [3,] "que luchan" "que" "luchan" </span></span>
<span id="cb12-28"><a href="#cb12-28" aria-hidden="true" tabindex="-1"></a><span class="co">#&gt; [4,] "son mejores" "son" "mejores"</span></span>
<span id="cb12-29"><a href="#cb12-29" aria-hidden="true" tabindex="-1"></a><span class="co">#&gt; [5,] NA NA NA </span></span>
<span id="cb12-30"><a href="#cb12-30" aria-hidden="true" tabindex="-1"></a><span class="co">#&gt; [6,] "son muy" "son" "muy" </span></span>
<span id="cb12-31"><a href="#cb12-31" aria-hidden="true" tabindex="-1"></a><span class="co">#&gt; [7,] "que luchan" "que" "luchan" </span></span>
<span id="cb12-32"><a href="#cb12-32" aria-hidden="true" tabindex="-1"></a><span class="co">#&gt; [8,] "son los" "son" "los" </span></span>
<span id="cb12-33"><a href="#cb12-33" aria-hidden="true" tabindex="-1"></a><span class="co">#&gt; [9,] NA NA NA</span></span>
<span id="cb12-34"><a href="#cb12-34" aria-hidden="true" tabindex="-1"></a><span class="fu">str_match</span>(estrofa, <span class="st">"(que|son) ([^ ]+)"</span>)</span>
<span id="cb12-35"><a href="#cb12-35" aria-hidden="true" tabindex="-1"></a><span class="co">#&gt; [,1] [,2] [,3] </span></span>
<span id="cb12-36"><a href="#cb12-36" aria-hidden="true" tabindex="-1"></a><span class="co">#&gt; [1,] "que luchan" "que" "luchan"</span></span>
<span id="cb12-37"><a href="#cb12-37" aria-hidden="true" tabindex="-1"></a><span class="fu">str_match_all</span>(estrofa, <span class="st">"(que|son) ([^ ]+)"</span>)</span>
<span id="cb12-38"><a href="#cb12-38" aria-hidden="true" tabindex="-1"></a><span class="co">#&gt; [[1]]</span></span>
<span id="cb12-39"><a href="#cb12-39" aria-hidden="true" tabindex="-1"></a><span class="co">#&gt; [,1] [,2] [,3] </span></span>
<span id="cb12-40"><a href="#cb12-40" aria-hidden="true" tabindex="-1"></a><span class="co">#&gt; [1,] "que luchan" "que" "luchan" </span></span>
<span id="cb12-41"><a href="#cb12-41" aria-hidden="true" tabindex="-1"></a><span class="co">#&gt; [2,] "son buenos." "son" "buenos." </span></span>
<span id="cb12-42"><a href="#cb12-42" aria-hidden="true" tabindex="-1"></a><span class="co">#&gt; [3,] "que luchan" "que" "luchan" </span></span>
<span id="cb12-43"><a href="#cb12-43" aria-hidden="true" tabindex="-1"></a><span class="co">#&gt; [4,] "son mejores." "son" "mejores."</span></span>
<span id="cb12-44"><a href="#cb12-44" aria-hidden="true" tabindex="-1"></a><span class="co">#&gt; [5,] "son muy" "son" "muy" </span></span>
<span id="cb12-45"><a href="#cb12-45" aria-hidden="true" tabindex="-1"></a><span class="co">#&gt; [6,] "que luchan" "que" "luchan" </span></span>
<span id="cb12-46"><a href="#cb12-46" aria-hidden="true" tabindex="-1"></a><span class="co">#&gt; [7,] "son los" "son" "los"</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<span id="cb12-12"><a href="#cb12-12" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb12-13"><a href="#cb12-13" aria-hidden="true" tabindex="-1"></a><span class="fu">str_match</span>(versos, <span class="st">"(son) (buenos|mejores)"</span>)</span>
<span id="cb12-14"><a href="#cb12-14" aria-hidden="true" tabindex="-1"></a><span class="co">#&gt; [,1] [,2] [,3] </span></span>
<span id="cb12-15"><a href="#cb12-15" aria-hidden="true" tabindex="-1"></a><span class="co">#&gt; [1,] NA NA NA </span></span>
<span id="cb12-16"><a href="#cb12-16" aria-hidden="true" tabindex="-1"></a><span class="co">#&gt; [2,] "son buenos" "son" "buenos" </span></span>
<span id="cb12-17"><a href="#cb12-17" aria-hidden="true" tabindex="-1"></a><span class="co">#&gt; [3,] NA NA NA </span></span>
<span id="cb12-18"><a href="#cb12-18" aria-hidden="true" tabindex="-1"></a><span class="co">#&gt; [4,] "son mejores" "son" "mejores"</span></span>
<span id="cb12-19"><a href="#cb12-19" aria-hidden="true" tabindex="-1"></a><span class="co">#&gt; [5,] NA NA NA </span></span>
<span id="cb12-20"><a href="#cb12-20" aria-hidden="true" tabindex="-1"></a><span class="co">#&gt; [6,] NA NA NA </span></span>
<span id="cb12-21"><a href="#cb12-21" aria-hidden="true" tabindex="-1"></a><span class="co">#&gt; [7,] NA NA NA </span></span>
<span id="cb12-22"><a href="#cb12-22" aria-hidden="true" tabindex="-1"></a><span class="co">#&gt; [8,] NA NA NA </span></span>
<span id="cb12-23"><a href="#cb12-23" aria-hidden="true" tabindex="-1"></a><span class="co">#&gt; [9,] NA NA NA</span></span>
<span id="cb12-24"><a href="#cb12-24" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb12-25"><a href="#cb12-25" aria-hidden="true" tabindex="-1"></a><span class="fu">str_match</span>(versos, <span class="st">"(que|son) ([^ ]+)"</span>)</span>
<span id="cb12-26"><a href="#cb12-26" aria-hidden="true" tabindex="-1"></a><span class="co">#&gt; [,1] [,2] [,3] </span></span>
<span id="cb12-27"><a href="#cb12-27" aria-hidden="true" tabindex="-1"></a><span class="co">#&gt; [1,] "que luchan" "que" "luchan" </span></span>
<span id="cb12-28"><a href="#cb12-28" aria-hidden="true" tabindex="-1"></a><span class="co">#&gt; [2,] "son buenos" "son" "buenos" </span></span>
<span id="cb12-29"><a href="#cb12-29" aria-hidden="true" tabindex="-1"></a><span class="co">#&gt; [3,] "que luchan" "que" "luchan" </span></span>
<span id="cb12-30"><a href="#cb12-30" aria-hidden="true" tabindex="-1"></a><span class="co">#&gt; [4,] "son mejores" "son" "mejores"</span></span>
<span id="cb12-31"><a href="#cb12-31" aria-hidden="true" tabindex="-1"></a><span class="co">#&gt; [5,] NA NA NA </span></span>
<span id="cb12-32"><a href="#cb12-32" aria-hidden="true" tabindex="-1"></a><span class="co">#&gt; [6,] "son muy" "son" "muy" </span></span>
<span id="cb12-33"><a href="#cb12-33" aria-hidden="true" tabindex="-1"></a><span class="co">#&gt; [7,] "que luchan" "que" "luchan" </span></span>
<span id="cb12-34"><a href="#cb12-34" aria-hidden="true" tabindex="-1"></a><span class="co">#&gt; [8,] "son los" "son" "los" </span></span>
<span id="cb12-35"><a href="#cb12-35" aria-hidden="true" tabindex="-1"></a><span class="co">#&gt; [9,] NA NA NA</span></span>
<span id="cb12-36"><a href="#cb12-36" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb12-37"><a href="#cb12-37" aria-hidden="true" tabindex="-1"></a><span class="fu">str_match</span>(estrofa, <span class="st">"(que|son) ([^ ]+)"</span>)</span>
<span id="cb12-38"><a href="#cb12-38" aria-hidden="true" tabindex="-1"></a><span class="co">#&gt; [,1] [,2] [,3] </span></span>
<span id="cb12-39"><a href="#cb12-39" aria-hidden="true" tabindex="-1"></a><span class="co">#&gt; [1,] "que luchan" "que" "luchan"</span></span>
<span id="cb12-40"><a href="#cb12-40" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb12-41"><a href="#cb12-41" aria-hidden="true" tabindex="-1"></a><span class="fu">str_match_all</span>(estrofa, <span class="st">"(que|son) ([^ ]+)"</span>)</span>
<span id="cb12-42"><a href="#cb12-42" aria-hidden="true" tabindex="-1"></a><span class="co">#&gt; [[1]]</span></span>
<span id="cb12-43"><a href="#cb12-43" aria-hidden="true" tabindex="-1"></a><span class="co">#&gt; [,1] [,2] [,3] </span></span>
<span id="cb12-44"><a href="#cb12-44" aria-hidden="true" tabindex="-1"></a><span class="co">#&gt; [1,] "que luchan" "que" "luchan" </span></span>
<span id="cb12-45"><a href="#cb12-45" aria-hidden="true" tabindex="-1"></a><span class="co">#&gt; [2,] "son buenos." "son" "buenos." </span></span>
<span id="cb12-46"><a href="#cb12-46" aria-hidden="true" tabindex="-1"></a><span class="co">#&gt; [3,] "que luchan" "que" "luchan" </span></span>
<span id="cb12-47"><a href="#cb12-47" aria-hidden="true" tabindex="-1"></a><span class="co">#&gt; [4,] "son mejores." "son" "mejores."</span></span>
<span id="cb12-48"><a href="#cb12-48" aria-hidden="true" tabindex="-1"></a><span class="co">#&gt; [5,] "son muy" "son" "muy" </span></span>
<span id="cb12-49"><a href="#cb12-49" aria-hidden="true" tabindex="-1"></a><span class="co">#&gt; [6,] "que luchan" "que" "luchan" </span></span>
<span id="cb12-50"><a href="#cb12-50" aria-hidden="true" tabindex="-1"></a><span class="co">#&gt; [7,] "son los" "son" "los"</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
</section>
</section>
Expand Down
4 changes: 4 additions & 0 deletions stringr.md
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,7 @@ str_match(versos, "son")
#> [7,] NA
#> [8,] "son"
#> [9,] NA

str_match(versos, "(son) (buenos|mejores)")
#> [,1] [,2] [,3]
#> [1,] NA NA NA
Expand All @@ -331,6 +332,7 @@ str_match(versos, "(son) (buenos|mejores)")
#> [7,] NA NA NA
#> [8,] NA NA NA
#> [9,] NA NA NA

str_match(versos, "(que|son) ([^ ]+)")
#> [,1] [,2] [,3]
#> [1,] "que luchan" "que" "luchan"
Expand All @@ -342,9 +344,11 @@ str_match(versos, "(que|son) ([^ ]+)")
#> [7,] "que luchan" "que" "luchan"
#> [8,] "son los" "son" "los"
#> [9,] NA NA NA

str_match(estrofa, "(que|son) ([^ ]+)")
#> [,1] [,2] [,3]
#> [1,] "que luchan" "que" "luchan"

str_match_all(estrofa, "(que|son) ([^ ]+)")
#> [[1]]
#> [,1] [,2] [,3]
Expand Down
4 changes: 4 additions & 0 deletions stringr.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -196,9 +196,13 @@ La función `str_match(texto, patrón)` realiza lo mismo que la función `str_ex

```{r str_match()}
str_match(versos, "son")
str_match(versos, "(son) (buenos|mejores)")
str_match(versos, "(que|son) ([^ ]+)")
str_match(estrofa, "(que|son) ([^ ]+)")
str_match_all(estrofa, "(que|son) ([^ ]+)")
```

Expand Down

0 comments on commit 84fa3b1

Please sign in to comment.