Learn R Programming

animation (version 1.1-0)

vanke1127: 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)

Arguments

source

This data can be obtained from most stock websites.

Examples

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

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)
})

Run the code above in your browser using DataLab