R Under development (unstable) (2013-06-11 r62941) -- "Unsuffered Consequences" Copyright (C) 2013 The R Foundation for Statistical Computing Platform: x86_64-unknown-linux-gnu (64-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. Natural language support but running in an English locale R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. [Previously saved workspace restored] > > lines <- readLines("web.html") > > # Use local css and javascript > lines <- gsub("http://www.w3.org/Talks/Tools/Slidy2/", "", lines) > # cannot use gzipped javascript locally > lines <- gsub("[.]gz", "", lines) > > # Remove all prefix args from gridsvg calls > lines <- gsub(', prefix=.+)', ")", lines) > > # Set up animation example to start on key press > lines <- gsub('begin="0s"', 'begin="accessKey(r)"', lines) > > # Hack the result because I can't make it do what I want > unwanted <- grep('id="section"', lines) > writeLines(lines[-unwanted], "web.html") > > > proc.time() user system elapsed 0.340 0.024 0.638