Description Usage Arguments Value Author(s) See Also Examples
View source: R/animatoR-functions-knitr.R
This function interpolates the symbol size between the start and end size.
1 |
cex0 |
numeric vector specifying start symbol size,
see |
cex1 |
numeric vector specifying end symbol size,
see |
t |
numeric, homotopy parameter, limited between 0 and 1. This parameter can be considered as fraction of animation duration time. |
when |
numeric vector. This parameter controls the times of: entrance, exit, start of movement and, end of movement. |
p |
numeric, homotopy power parameter. Defaults to 1. |
area |
logical, if TRUE (default) sizes will be treated as area. If FALSE, sizes will be considered by diameter. |
A numeric vector giving the amount by which plotting text
and symbols should be magnified relative to the
default cex
value.
Andrej Blejec andrej.blejec@nib.si
par
for
setting symbol sizes (cex
).
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | if(interactive()){
animator('
newplot()
points(3:7,3:7,col=1:5,
pch=16,cex=tcex(0,20,t),life=0.5)
')
}
if(interactive()){
# Doubling the symbol sizes
newplot()
text(2,8,"By edge:\n cex = c(8, 16)")
points(2,5,cex=16,pch=0)
points(2-0.75*par("cin")[2]*4,
5-0.75*par("cin")[2]*4,cex=8,pch=15, col="grey")
text(8,8,"By size:\n cex = sqrt(c(4, 16, 64))")
points(8,5,cex=sqrt(64*4),pch=0)
points(8,5,cex=sqrt(16*4),pch=15, col="grey")
points(8,5,cex=sqrt(4*4),pch=0)
abline(v=c(2,8),h=5,col="red")
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.