crawl | R Documentation |
This function crawls over txt
producing an animated gif-like
representation of the text unfolding from left to right or top to bottom,
depending on direction
, colored according to colors
.
crawl( txt = "hello world!", colors = NULL, recycle_chars = FALSE, direction = "vertical", pause = 0.05, ... )
txt |
(character) Some text to color, stripped of line breaks |
colors |
(character) A vector of colors to color each individual character, if
|
recycle_chars |
(logical) Should the vector of colors supplied apply to the entire string or
should it apply to each individual character (if |
direction |
(character) How should the colors be spread? One of "horizontal" or "vertical". |
pause |
(numeric) Seconds to pause between characters in seconds. |
... |
Further args passed to |
This function requires as many colors as there are characters in your string and
prints them one at a time.
colors
will be recycled in single-color equal-sized chunks if recycle_char
is FALSE and
character-by-character if recycle_char
is TRUE.
Colors cannot be applied in RGUI (R.app on some systems) or other environments that do not support
colored text. In these cases, the txt
will simply be crawled over without applying colors.
A string, printed in colors
with pause
seconds between printing each character.
crawl() crawl("It was a dark and stormy night") crawl("Taste the rainbow", colors = "rainbow") crawl(things[["hypnotoad"]], colors = c("purple", "blue", "cyan"), direction = "horizontal", recycle_chars = TRUE, pause = 0.01 ) options("keep.source = FALSE") crawl("\014A long time ago in a galaxy far, far away... It is a period of civil war. Rebel spaceships, striking from a hidden base, have won their first victory against the evil Galactic Empire.")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.