Posts Tagged ‘ plot ’

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

June 16, 2011
By

Here is the link to the original problem. Briefly, I was unable to plot a custom x-axis showing abbreviated months in a time series plot of a zoo object. In the plot.zoo() function set xaxt = "n" to suppress plotting … Continue reading →

Boxplots without boxes

June 14, 2011
By

Let’s say you have several categories with multiple data points each that you would like to plot as individual points. Even if you have only a single point, the R graphics package will plot a line (without a box for … Continue reading →

More fun with boxplots

May 19, 2011
By

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 →

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

April 7, 2011
By

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 →

Example 8.33: Merging data sets one-to-many

April 5, 2011
By

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...

Example 8.30: Compare Poisson and negative binomial count models

March 15, 2011
By

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...

Graphing – margins, titles, mtext, workspace

February 21, 2011
By

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 particularly useful (requires “oma=c(2,2,2,2)” or similar). http://addictedtor.free.fr/graphiques/ This site is somewhat of the way there, but I’ve found

Plotting Time Series data using ggplot2

September 30, 2010
By

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 short snippet of the data is shown

R: Clash of the cannon cycles

July 19, 2010
By

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. Just like the light

Visualization of regression coefficients (in R)

July 2, 2010
By

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 was exactly the question...