2079 search results for "ggplot"

knitr: Changing chunk options like fig.height programmatically, mid-chunk

February 22, 2013
By

Knitr is a great tool for doing reproducible research. You can produce all kinds of output inside a single knitr chunk, e.g. you can write a loop to produce lots of figures or tables. The only catch is if you want your figures to have differing captions, heights, etc (and usually you do). The standard

Read more »

Elevation Profiles in R

February 21, 2013
By
Elevation Profiles in R

First, let's load up our data. The data are available in a gist. You can convert your own GPS data to .csv by following the instructions here, using gpsbabel.gps <- read.csv("callan.csv",  header = TRUE)Next, we can use the function SMA fr...

Read more »

A slightly different introduction to R, part IV

February 21, 2013
By
A slightly different introduction to R, part IV

Now, after reading in data, making plots and organising commands with scripts and Sweave, we’re ready to do some numerical data analysis. If you’re following this introduction, you’ve probably been waiting for this moment, but I really think it’s a good idea to start with graphics and scripting before statistical calculations. We’ll use the silly

Read more »

Plot ranges of data in R

February 21, 2013
By
Plot ranges of data in R

How to control the limits of data values in R plots. R has multiple graphics engines.  Here we will talk about the base graphics and the ggplot2 package. We’ll create a bit of data to use in the examples: one2ten <- 1:10 ggplot2 demands that you have a data frame: ggdat <- data.frame(first=one2ten, second=one2ten) Seriously The post Plot...

Read more »

Analysis of Public .Rhistory Files

February 20, 2013
By
Analysis of Public .Rhistory Files

GitHub recently launched a more powerful search feature which has been used on more than one occasion to identify sensitive files that may be hosted in a public GitHub repository. When used innocently, there are all sorts of fun things you can find with this search feature. Inspired by Aldo Cortesi's post documenting his exploration

Read more »

Fixing My Internet With R and Python

February 20, 2013
By
Fixing My Internet With R and Python

Last summer, I had some internet connectivity problems. Specifically, I would have massive latency issues that affected my conversations on Skype and my relatively pathetic under the best of circumstances efforts at online gaming. It was driving me up a wall and I couldn't figure it out. It hadn't...

Read more »

To pre-pay or not to pre-pay for gas when renting a car?

February 20, 2013
By
To pre-pay or not to pre-pay for gas when renting a car?

One question we get asked a lot is whether it's worth it to pre-pay for the tank of gas when renting a car. At first, blush it seems like something you should never do. In the best case, you pay market rate for gas, and in the worst case, you pay for a tank of gas you never consume (what...

Read more »

Mapped: Twitter Languages in New York

February 20, 2013
By
Mapped: Twitter Languages in New York

Following the interest in our Twitter Tongues map for L

Read more »

Better modelling and visualisation of newspaper count data

February 19, 2013
By
Better modelling and visualisation of newspaper count data

<!-- Styles for R syntax highlighter In this post I outline how count data may be modelled using a negative binomial distribution in order to more accurately present trends in time series count data than using linear methods. I also show how to...

Read more »

10 R packages every data scientist should know about

February 18, 2013
By

The yhat blog lists 10 R packages they wish they'd known about earlier. Drew Conway calls them "10 reasons to always start your analysis in R". They're all very useful R packages that every data scientist should be aware of. They are: sqldf (for selecting from data frames using SQL) forecast (for easy forecasting of time series) plyr (data...

Read more »