# plot

### More fun with boxplots

May 19, 2011 |

Here are a few more plotting options for boxplots: Let’s start plotting the full set plot(b\$mod, b\$x) Plot labels for a subset in full set plot (label all points x __ -1) text(subset(b\$mod, b\$x __ -1), subset(b\$x, b\$x __ -1), … Continue reading → [Read more...]

### Unable to plot a decent x-Axis in a time series plot using zoo

April 7, 2011 |

I use the R package zoo to plot a yearly time series of weekly averaged data. The problem is that my date variable (m.all\$date) contains week numbers and these are plotted as x-Axis. What I would rather like to to … Continue reading → [Read more...]

### Example 8.33: Merging data sets one-to-many

April 5, 2011 |

It's often necessary to combine data from two data sets for further analysis. Such merging can be one-to-one, many-to-one, and many-to-many. The most common form is the one-to-one match, which we cover in section 1.5.7. Today we look at a one-to-man...
[Read more...]

### Example 8.30: Compare Poisson and negative binomial count models

March 15, 2011 |

How similar can a negative binomial distribution get to a Poisson distribution?When confronted with modeling count data, our first instinct is to use Poisson regression. But in practice, count data is often overdispersed. We can fit the overdispersio...
[Read more...]

### Graphing – margins, titles, mtext, workspace

February 21, 2011 |

This is a great post, very true, not enough of R’s graphics are well displayed online to really see how to achieve what the often ambiguous ‘help’ information suggests. http://research.stowers-institute.org/efg/R/Graphics/Basics/mar-oma/index.htm I particularly find “mtext(“lol”, outer=T)” to be ... [Read more...]

### Plotting Time Series data using ggplot2

September 30, 2010 |

There are various ways to plot data that is represented by a time series in R. The ggplot2 package has scales that can handle dates reasonably easily. Fast Tube by Casper As an example consider a data set on the number of views of the you tube channel ramstatvid. A ...
[Read more...]

### R: Clash of the cannon cycles

July 19, 2010 |

Imagine a unit square. Every side has length 1, perfectly square. Now imagine this square was really a fence, and you picked two spots at random along the fence, with uniform probability over the length of the fence. At each of these two locations, set down a special kind of cannon. ... [Read more...]

### Visualization of regression coefficients (in R)

July 2, 2010 |

Update (07.07.10): The function in this post has a more mature version in the “arm” package. See at the end of this post for more details. * * * * Imagine you want to give a presentation or report of your latest findings running some sort of regression analysis. How would you do it? This ... [Read more...]

### Repulsive dots pattern, the difference of distance

June 14, 2010 |

What if you wanted to randomly place objects into a field, and the more objects you had, the more they rejected newcomers placed nearby? To find out, I setup a simulation. The code, shown at the end, isn’t all that interesting, and the plots shown below aren’t all ... [Read more...]

### Example 7.41: hazard function plotting

June 14, 2010 |

As we continue with our series on survival analysis, we demonstrate how to plot estimated (smoothed) hazard functions. RWe will utilize the routines available in the muhaz package. Background information on the methods can be found in K.R. Hess, D.M....
[Read more...]

### R: More plotting fun with Poission

May 28, 2010 |

Coded as follows: x = seq(.001,50,.001) par(bg="black") par(mar=c(0,0,0,0)) plot(x,sin(1/x)*rpois(length(x),x),pch=20,col="blue") [Read more...]

### First annual R plot replication prize

May 3, 2010 |

\$100 to the first person who can figure out how I created this plot and replicate it. Some hints: It was done in R. There is only one underlying probability distribution involved (one “rdist()“). Including the “plot” statement, I created this with 3 short lines of code. This is based on a ... [Read more...]

### R: more plotting fun, this time with the Poisson

April 21, 2010 |

Click on image for a larger version. Here is the code: par(bg="black") par(mar=c(0,0,0,0)) plot(sort(rpois(10000,100))/rpois(10000,100),frame.plot=F,pch=20,col="blue") [Read more...]

### Summarising data using scatter plots

April 18, 2010 |

A scatter plot is a graph used to investigate the relationship between two variables in a data set. The x and y axes are used for the values of the two variables and a symbol on the graph represents the combination for each pair of values in the data set. ...
[Read more...]

### R: another nifty graph

April 8, 2010 |

Make sure to click on the image to see the large version. Code for this graph: moxbuller = function(n) { u = runif(n) v = runif(n) x = cos(2*pi*u)*sqrt(-2*log(v)) y = sin(2*pi*v)*sqrt(-2*log(u)) r = list(x=x, y=y) return(r) } r = ... [Read more...]

### Summarising data using dot plots

March 26, 2010 |

A dot plot is a type of display that compares counts, frequencies, totals or other summary measures for a series of categories. The dot plot can be arranged with the categories either on the vertical or horizontal axis of the display to allow comparising between the different categories as well ... [Read more...]

### R plotting fun

March 25, 2010 |

Not easy to produce cool looking graphs in R, but it can be done. The results of some messing around are above. Here is the code I used: [Read more...]

### R: Add vertical line to a plot

March 21, 2010 |

If you have a plot open and want to add a vertical line to it: abline(v=20) #Add vertical line at x=20 [Read more...]

### Nutritional supplements efficacy score – Graphing plots of current studies results (using R)

February 25, 2010 |

In this post I showcase a nice bar-plot and a balloon-plot listing recommended Nutritional supplements , according to how much evidence exists for thier benefits, scroll down to see it(and click here for the data behind it) * * * * The gorgeous blog “Information Is Beautiful” recently publish an eye candy post showing ...
[Read more...]

### ggplot2: Two Color XY-Area Combo Chart

October 21, 2009 |

[email protected] blog shows how to fill in the area between two crossing lines in an Excel chart. This post was also published as a guest-post on PTS blog. Let’s try to replicate this graph in ggplot2. First, load ggplot2 and generate the data frame to be used in ... [Read more...]
1 2 3

# 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)