EVOLUTION-MANAGER
Edit File: word.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Extract words from a sentence.</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for word {stringr}"><tr><td>word {stringr}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Extract words from a sentence.</h2> <h3>Description</h3> <p>Extract words from a sentence. </p> <h3>Usage</h3> <pre> word(string, start = 1L, end = start, sep = fixed(" ")) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>string</code></td> <td> <p>input character vector.</p> </td></tr> <tr valign="top"><td><code>start</code></td> <td> <p>integer vector giving position of first word to extract. Defaults to first word. If negative, counts backwards from last character.</p> </td></tr> <tr valign="top"><td><code>end</code></td> <td> <p>integer vector giving position of last word to extract. Defaults to first word. If negative, counts backwards from last character.</p> </td></tr> <tr valign="top"><td><code>sep</code></td> <td> <p>separator between words. Defaults to single space.</p> </td></tr> </table> <h3>Value</h3> <p>character vector of words from <code>start</code> to <code>end</code> (inclusive). Will be length of longest input argument. </p> <h3>Examples</h3> <pre> sentences <- c("Jane saw a cat", "Jane sat down") word(sentences, 1) word(sentences, 2) word(sentences, -1) word(sentences, 2, -1) # Also vectorised over start and end word(sentences[1], 1:3, -1) word(sentences[1], 1, 1:4) # Can define words by other separators str <- 'abc.def..123.4568.999' word(str, 1, sep = fixed('..')) word(str, 2, sep = fixed('..')) </pre> <hr /><div style="text-align: center;">[Package <em>stringr</em> version 1.4.0 <a href="00Index.html">Index</a>]</div> </body></html>