[R] Animation Problem
R. Michael Weylandt
michael.weylandt at gmail.com
Tue Sep 11 18:09:29 CEST 2012
On Tue, Sep 11, 2012 at 4:52 PM, Bhupendrasinh Thakre
<vickythakre at gmail.com> wrote:
> Hi List,
>
> I am trying to build an animation and facing problem as animation is not
> coming "live".
> The goal is to build "heart beats" like diagram for the data given below.
>
> data :
>
> structure(list(date = 1971:1991, x = c(41L, 60L, 41L, 61L, 22L,
> 83L, 31L, 55L, 22L, 14L, 38L, 6L, 29L, 17L, 10L, 99L, 88L, 32L,
> 68L, 78L, 26L)), .Names = c("date", "x"), class = "data.frame",
> row.names = c(NA,
> -21L))
>
> Program :
>
>> library(animation)> library(ggplot2)
>
>> anim <- function(a){for (i in seq(1,21))
> {pl <-
> ggplot(a1111,aes(x=date,y=x))+geom_line()+scale_x_continuous(limits=c(1971,1991))+
> scale_y_continuous(limits=c(0,100))
> print(pl)}}
This bit came out a bit mangled (if you could repost it with nicer
formatting that'd be appreciated), but I see no dependence on i in
here so there might simply not be any change to observe.
Cheers,
Michael
>
>> saveMovie(anim(),interval=0.1,outdir=getwd())
>
> Session Info :
>
> R version 2.15.1 (2012-06-22)
> Platform: i386-pc-mingw32/i386 (32-bit)
>
> locale:
> [1] LC_COLLATE=English_United States.1252
> [2] LC_CTYPE=English_United States.1252
> [3] LC_MONETARY=English_United States.1252
> [4] LC_NUMERIC=C
> [5] LC_TIME=English_United States.1252
>
> attached base packages:
> [1] stats graphics grDevices datasets utils methods
> [7] base
>
> other attached packages:
> [1] animation_2.1 ggplot2_0.9.1 igraph_0.6-2 rcom_2.2-5
> [5] rscproxy_2.0-5
>
> loaded via a namespace (and not attached):
> [1] colorspace_1.1-1 dichromat_1.2-4 digest_0.5.2
> [4] grid_2.15.1 labeling_0.1 MASS_7.3-18
> [7] memoise_0.1 munsell_0.3 plyr_1.7.1
> [10] proto_0.3-9.2 RColorBrewer_1.0-5 reshape2_1.2.1
> [13] RGtk2_2.20.25 scales_0.2.1 stringr_0.6.1
> [16] tools_2.15.1
>
>
> Can some one help me to find the problem. The plot is coming but
> not the animation.
>
>
>
>
> Best Regards,
>
>
> Bhupendrasinh Thakre
>
> *Disclaimer :*
>
> The information contained in this communication is confi...{{dropped:11}}
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
More information about the R-help
mailing list