vanke1127 {animation}R Documentation

Stock prices of Vanke Co., Ltd on 2009/11/27

Description

This is a sample of stock prices of the Vanke Co., Ltd on 2009/11/27.

Usage

data(vanke1127)

Format

A data frame with 2831 observations on the following 2 variables.

time
POSIXt: the time corresponding to stock prices
price
a numeric vector: stock prices

Source

This data can be obtained from most stock websites.

Examples

data(vanke1127)
with(vanke1127, {
    tab.price = table(price)
    plot(as.numeric(names(tab.price)), tab.price, type = "h", 
        xlab = "price", ylab = "frequency")
}) 

## Not run: 
ani.options(interval = 0.5, loop = FALSE)

with(vanke1127, {
    ## a series of HTML animations with different time spans
    ani.start(title = "Prices changing along with time interval 15 min")
    price.ani(price, time, lwd = 2)
    ani.stop()
    
    ani.start(title = "Prices changing along with time interval 30 min")
    price.ani(price, time, span = 30 * 60, lwd = 3)
    ani.stop()
    
    ani.start(title = "Prices changing along with time interval 5 min")
    price.ani(price, time, span = 5 * 60, lwd = 2)
    ani.stop()
    
    ## GIF animation
    saveMovie(price.ani(price, time, lwd = 2), interval = 1, 
        moviename = "price", loop = 1)
}) 
## End(Not run)

[Package animation version 1.0-10 Index]