Description Usage Arguments Value Reuse good code Alternative
A standard left function.
1 | left(s, n)
|
s |
Character vector. |
n |
Scalar of vector of the same lenght as |
The leftmost n characters of a string.
"The single biggest way to improve both the quality of your code and your productivity is to reuse good code (...) Many algorithms have already been invented, tested, discussed in the trade literature, reviewed, and improved".
–Code complete 2, by Steve McConnell.
A more powerful and general alternative is stringr::str_sub()
:
1 2 3 4 5 6 7 8 9 10 11 12 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.