And so begins English Composition I

March 21, 2013

(This article was first published on Fellgernon Bit - rstats, and kindly contributed to R-bloggers)

This week started the English Composition I: Achieving Expertise course (Comer, 2013) that I have been looking forward to.

I am not sure yet how long I will last, but I hope to enjoy it as much as I can. Plus, it should help me with my posting and other writing areas. While I last in the course, I plan to publish my writings in the blog too. So you will hopefully see me be more active here.

As it is important to cite when writing, I have also figured out how to do so automatically in Rmd files. For that I learnt how to use knitcitations from the GitHub instructions (knitcitations) and a explanatory post (Boettiger, 2013).

knitcitations is great, but it kind of struggles with some pages. That is why I modified my template in FBit by writing my own citing function for pages where citep fails. Here is the code:

## I made my own citing function since citep() doesn't work like I want to with
## urls that are not really pages themselve like part of a GitHub repo.
mycitep <- function(x, short, year=substr(date(), 21, 24), tooltip=TRUE) {
    tmp <- citep(x)
    res <- gsub(">", paste0(">", short, ""), tmp)
    if(tooltip) {
        res <- gsub("\\?\\?\\?\\?", year, res)

## You already saw an inline working example in the post itself.

To leave a comment for the author, please follow the link and comment on their blog: Fellgernon Bit - rstats. offers daily e-mail updates about R news and tutorials on topics such as: Data science, Big Data, R jobs, visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...

If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...

Comments are closed.


Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)