knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" )
The goal of WordsChars is to count the number of characters and words in a given string. You can decide weather you want to count spaces as character or not. When given a string to count, you will get a vector in return whose first element is the number of characters and second element is the number of words.
WordsChars is not yet in CRAN. But, you can install the development version of WordsChars like so:
devtools::install_github("jburckhardt/WordsChars")
This is a basic example which shows you how to solve a common problem:
library(WordsChars) count_chr_words("Hello World", count_spaces = TRUE)
This package also allows you to not count spaces as characters!
count_chr_words("Hello World", count_spaces = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.