View source: R/Animate.character.R
Animate.character | R Documentation |
Animate.character
- Animate a character
object.
Typically this function is useful in conjunction with other Animate
objects to create complex animations with accompanying text.
## S3 method for class 'character'
Animate(
x,
wc.time = TRUE,
time.constant = 2,
width = 65,
coord = c(0, 0.5),
just = c(0, 0.5),
size = 5,
color = "black",
border.color = NA,
...
)
x |
A |
wc.time |
logical. If |
time.constant |
A constant to divide the maximum word count by. Time is calculated by 'round(exp(WORD COUNT/(max(WORD COUNT)/time.constant)))'. Therefore a larger constant will make the difference between the large and small word counts greater. |
width |
The width to break text at if |
coord |
The x/y coordinate to plot the text.. |
just |
The |
size |
The size to print the text. Can be a vector of length 1 or equal
to the length of |
color |
The color to print the text. Can be a vector of length 1 or equal
to the length of |
border.color |
The |
... |
Other arguments passed to |
character Method for Animate
theme
## Not run:
Animate(DATA[["state"]])
Animate(DATA[["state"]], color="red")
Animate(DATA[["state"]], color=RColorBrewer::brewer.pal(11, "Set3"), size=10)
cls <- DATA[["person"]] %l% data.frame(levels(DATA[["person"]]),
RColorBrewer::brewer.pal(5, "Set3"))
Animate(DATA[["state"]], color=cls, size=10, width=30)
cls2 <- DATA[["sex"]] %l% data.frame(c("m", "f"),c("lightblue", "pink"))
Animate(DATA[["state"]], color=cls2, just=c(.5, .5), coord = c(.5, .5))
## Print method
print(Animate(DATA[["state"]], color=cls2, just=c(.5, .5), coord = c(.5, .5)),
pause=.25)
Animate(DATA[["state"]], color=sample(colors(), nrow(DATA)),
size=sample(4:13, nrow(DATA), TRUE), width=30, just=c(.5, .5), coord = c(.5, .5))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.