457 search results for "knitr"

Writing papers using R Markdown

Writing papers using R Markdown

Writing papers using R Markdown I have been watching the activity in RStudio and knitr for a while, and have even been using Rmd (R markdown) files in my own work as a way to easily provide commentary on an actual dataset analysis. Yihui has proposed writing papers in markdown and posting them to a blog as a way...

Read more »

24 Days of R: Day 9

December 9, 2013
By
24 Days of R: Day 9

This will be the third time I've tried to write this post. I had started out presuming that I would uncover something fascinating about applying Bayesian inference to a low-frequency claims generation process. That isn't at all what I got and I ought to have known better when I started. I started by doing very

Read more »

Hive Plots using R and Cytoscape

Hive Plots using R and Cytoscape

(This article was first published on Deciphering life: One bit at a time :: R, and kindly contributed to R-bloggers) I found out about HivePlots this past summer, and although I thought they looked incredibly useful and awesome, I didn't have a personal use for them at the time, and therefore put off doing anything with them. That recently...

Read more »

Tim Hortons Density

Tim Hortons Density

Tim Hortons Density Inspired by this post, I wanted to examine the locations and density of Tim Hortons restaurants in Canada. Using Stats Canada data, each census tract is queried on Foursquare for Tims locations. Setup options(stringsAsFactors = F) require(timmysDensity) require(plyr) require(maps) require(ggplot2) require(geosphere) Statistics Canada Census Data The actual Statistics Canada data at the dissemination block level can be downloaded from here. You will want to...

Read more »

24 Days of R: Day 8

December 7, 2013
By
24 Days of R: Day 8

I saved the data from the last post which shows the percentage of Republican voters in each county. In addition to that column, I also have figures from the 2010 census. This will show things like age, ethnicity, urbanization and home ownership. Those census figures show actual population counts, so they'll need to be altered

Read more »

24 Days of R: Day 7

December 7, 2013
By
24 Days of R: Day 7

Carrying on from the last post, I'm going to take a closer look at election results for the 2012 US presidential election in North Carolina. This state's 15 electoral votes went to the Republican, Mitt Romney. On the US electoral college map, that means the state shows up as red. As I write this, I'm

Read more »

24 Days of R: Day 6

December 6, 2013
By
24 Days of R: Day 6

I've finally had some success at munging some HTML. For quite some time, I've wanted to render a county level choropleth for US presidential election results. The numbers are all there on Politico.com, but attempts to use readHTMLTable never returned the full set of data. It still doesn't, but I have sorted out how to

Read more »

24 Days of R: Day 5

December 5, 2013
By
24 Days of R: Day 5

Some time back, I started a project on GitHub wherein I would explore the efficacy of financial literacy efforts in the area where I live. This is done with the support of a local non-profit organization. As a first step, I tried to draw a picture of the area at a relatively fine level of

Read more »

24 Days of R: Day 4

December 4, 2013
By
24 Days of R: Day 4

So my first attempt to sort out the career of Michael Caine via parsing of HTML data was a wash. I'm going to try this again, using Wikipedia. They've got a nice, easy list of his films in an HTML table. Reading an HTML table into R is incredibly easy. The XML library has a

Read more »

24 Days of R: Day 3

December 3, 2013
By
24 Days of R: Day 3

This is the post where we begin to talk about Michael Caine. There's no strong reason for this. It's not as though I have a great fascination with him. Don't get me wrong, I think he's a fine actor. Michael Caine happened to cross my mind a couple weeks ago when I was listening to

Read more »