Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I really like using <code>interaction</code> by agstudy - I would probably try this first. But if keeping things unchanged then:</p> <p>4 factors could be accomodated with faceting and 2 axes. Then there are 2 metrics <em>x</em> and <em>y</em>: one option is a bubble chart with both metrics distinguishing by color or shape or both (added jitter to make shapes less overlapping):</p> <pre><code>testm = melt(test, id=c('siteloc', 'modeltype', 'mth', 'yr')) # by color ggplot(testm, aes(x=siteloc, y=modeltype, size=value, colour=variable)) + geom_point(shape=21, position="jitter") + facet_grid(mth~yr) + scale_size_area(max_size=40) + scale_shape(solid=FALSE) + theme_bw() </code></pre> <p><img src="https://i.stack.imgur.com/WOhhu.png" alt="Metrics distinguished by color"></p> <pre><code>#by shape testm$shape = as.factor(with(testm, ifelse(variable=='x', 21, 25))) ggplot(testm, aes(x=siteloc, y=modeltype, size=value, shape=shape)) + geom_point(position="jitter") + facet_grid(mth~yr) + scale_size_area(max_size=40) + scale_shape(solid=FALSE) + theme_bw() </code></pre> <p><img src="https://i.stack.imgur.com/M7GpQ.png" alt="enter image description here"></p> <pre><code># by shape and color ggplot(testm, aes(x=siteloc, y=modeltype, size=value, colour=variable, shape=shape)) + geom_point(position="jitter") + facet_grid(mth~yr) + scale_size_area(max_size=40) + scale_shape(solid=FALSE) + theme_bw() </code></pre> <p><img src="https://i.stack.imgur.com/hMzg5.png" alt="enter image description here"></p> <p><strong>UPDATE:</strong></p> <p>This is attempt based on 1st comment by Dominik to show if (x,y) is above or below 1:1 line and how big is the ratio <em>x/y</em> or <em>y/x</em> - blue triangle is if x/y>1, red circle otherwise (no need in <code>melt</code> in this case):</p> <pre><code>test$shape = as.factor(with(test, ifelse(x/y&gt;1, 25, 21))) test$ratio = with(test, ifelse(x/y&gt;1, x/y, y/x)) ggplot(test, aes(x=siteloc, y=modeltype, size=ratio, colour=shape, shape=shape)) + geom_point() + facet_grid(mth~yr) + scale_size_area(max_size=40) + scale_shape(solid=FALSE) + theme_bw() </code></pre> <p><img src="https://i.stack.imgur.com/wurUz.png" alt="enter image description here"></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload