tag:blogger.com,1999:blog-7962747614418616580.comments2014-06-19T08:56:17.235-07:00Speekenbrink lab blogUnknownnoreply@blogger.comBlogger3125tag:blogger.com,1999:blog-7962747614418616580.post-66046761934028810512014-06-19T08:56:17.235-07:002014-06-19T08:56:17.235-07:00Cool, thank you Maarten.Cool, thank you Maarten.Anonymoushttps://www.blogger.com/profile/02022914660920820838noreply@blogger.comtag:blogger.com,1999:blog-7962747614418616580.post-47865420652896954722014-02-24T02:42:02.852-08:002014-02-24T02:42:02.852-08:00Thanks Richard, pasting everything in one string i...Thanks Richard, pasting everything in one string is a good idea. I will update the code.Maarten Speekenbrinkhttps://www.blogger.com/profile/09131225790570367817noreply@blogger.comtag:blogger.com,1999:blog-7962747614418616580.post-81883949533517234462014-02-11T08:28:10.220-08:002014-02-11T08:28:10.220-08:00There's a problem in the function - it will ge...There's a problem in the function - it will get rid of /code inappropriately sometimes, leaving the entire rest of the post in code font. You can replace a few lines to correct this:<br /><br /> tmp <- readLines(htm.name)<br /> ## Paste everything together into one string<br /> ## for matches across lines<br /> tmp <- paste(tmp,collapse="\n")<br /><br /> ## substitue important parts<br /> ## ensuring that we resubstitute the content back with the <br /> ## appropriate </code> tag<br /> tmp <- gsub("<pre><code class=\"r\">(.*?)</code></pre>", <br /> "<pre class=\"brush: r\">\\1</pre>", tmp) Richard Moreyhttps://www.blogger.com/profile/11319149283079163004noreply@blogger.com