Monthly Archives: February 2014

Automated R Blogging (How To Capitalize Specific Letters in a String with R)

In the woRld of R blogging it can sometimes be fun to wRite with all the Rs capitalized. This is entertaining for both the author and the reader but not very efficient. It’s tough to remember to capitalize letters in the middle of the word and even if the writer does remember, it’s extra work to press the shift key. Instead, let’s automate the capitalization of Rs. Luckily, this is pretty easy in R:

# First, make an example blog post
data <- "Many times I want to write in r style but I never have the time to even though it makes the other users think I am rad."

# Now use gsub to convert r to R
data <- gsub("r", "R", data)

# Show the new and improved post
print(data)
[1] "Many times I want to wRite in R style but I neveR have the time to even though it makes the otheR useRs think I am Rad."

Calling for Presenters for the Madison R Meetup!

Want to present at the Madison R meetup or know someone who might? I’m looking for both short (5 to 30 minutes) and long presentations for future meetups. Short presentations will be grouped with other short presentations to fill up a meeting while longer presentations will have the time to themselves.

Any R related topic that others might find interesting or useful is welcome. Please contact me through the Meetup or through the rprogramming.net contact form if interested in presenting.