Description Usage Arguments Details See Also Examples
View source: R/Animate.character.R
Animate.character
- Animate a character
object.
Typically this function is useful in conjunction with other Animate
objects to create complex animations with accompanying text.
1 2 3 4 5 6 7 8 9 10 11 12 13 |
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
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | ## 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.