What sort of plot am I looking for?



I'd like to plot some of my results (because plots are cooler than text), but I don't know exactly what I'm looking for...

I have data like this:

~ID, ~test, ~result,  ~position,
  1, 1,     0,        "level1loc1",  
  2, 1,     1,        "level1loc2",
  2, 2,     1,        "level2loc3",
  3, 2,     1,        "level3loc1",
  4, 1,     1,        "level2loc2",
  4, 1,     1,        "level1loc3",
  5, 1,     0,        "level2loc4", 

I'm not sure if the ID group is really relevant for the purpose of plotting. What I'd like to do is plot the results of test 1 or 2 as a proportion in each position in some sort of 3d or facetted matrix (where levels are facets). The positions don't really have any order, they numbers in the position variable are just for clarity - in total there are 3 levels with 4 locations. This means I'll also have to specify where each location is for each level.

Any suggestions are greatly appreciated!

Edit: I forgot to mention that test 2 only has 1 position observation, while test 1 might have levels (3) x location (4) = 12 observations.


The best chart for a dataset depends on a number of factors, including what it is you're trying to show. Exploratory data analysis and visualization can help you get there by going through some iterations, but it's very difficult for someone else to say what's best without context (and, even then, it'll be easier if you include a couple example charts of your results, which you can do by including a self-contained reprex (short for minimal reproducible example)).

You might want to take a look at a site (one example is https://www.data-to-viz.com/, Andrew Abela's chart chooser is another https://datavizblog.com/2013/04/29/andrew-abelas-chart-chooser/) that takes you through a series of choices to help you pick a chart as a launching-off point.


Thank you, data-to-viz.com == awesome!

However I couldn't find exactly what I'm looking for. Essentially, what I need is ggbrain just for another organ. A simplified version would be something like a (plotted) 2x2 or 4x4 table where I can assign names to each "cell".

I guess this is as good an excuse as any to learn how I make a package...:open_mouth: