Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 201867

How to make a boxplot with 3D array with ggplot?

$
0
0

I have technical question for you please.

Here are my observed data. :

observed <- structure(c(4.06530084555243e-05, 4.34037362577724e-05, 5.25472735118296e-05, 
                        5.75250282219017e-05, 5.33322813829422e-05, 4.31323519093776e-05, 
                        2.93059438168564e-05, 3.2907253754896e-05, 3.93244409813805e-05, 
                        4.44607200813546e-05, 4.28121839343577e-05, 4.41339340180233e-05, 
                        2.45819615043229e-05, 2.77652788697063e-05, 3.471280169582e-05, 
                        4.0759303004447e-05, 4.1444945573338e-05, 3.91053759171617e-05
), .Dim = c(6L, 3L))

After a simulation I have this dataset :

simul <- structure(c(4.19400641566714e-05, 4.34037362577724e-05, 5.21778240776188e-05, 
                        5.72766282640455e-05, 5.33322813829422e-05, 4.4984474595369e-05, 
                        3.04758260711529e-05, 3.35466566427138e-05, 4.07527347018512e-05, 
                        4.51672959887775e-05, 4.42496416020706e-05, 4.41339340180233e-05, 
                        2.38725672336555e-05, 2.78960210968267e-05, 3.42390390339277e-05, 
                        4.0759303004447e-05, 4.1444945573338e-05, 4.16181419135288e-05, 
                        4.06530084555243e-05, 4.52163381730998e-05, 5.37744538705153e-05, 
                        5.75250282219017e-05, 5.44384786782902e-05, 4.27640158845638e-05, 
                        2.93059438168564e-05, 3.16988003284864e-05, 3.88757470111112e-05, 
                        4.16839537839391e-05, 4.1923490779897e-05, 4.43697930071784e-05, 
                        2.53312977844189e-05, 2.82780740113101e-05, 3.49483644305925e-05, 
                        4.23308636691264e-05, 4.36574393087853e-05, 3.91053759171617e-05, 
                        3.97856427517231e-05, 4.25485977213641e-05, 5.21380124071012e-05, 
                        5.62879076217168e-05, 5.18161751345512e-05, 4.22404154190924e-05, 
                        2.84842421189343e-05, 3.2907253754896e-05, 3.93244409813805e-05, 
                        4.28921326811218e-05, 4.2391125283836e-05, 4.28233487269764e-05, 
                        2.45819615043229e-05, 2.67311845213199e-05, 3.3715109777394e-05, 
                        4.00991849427121e-05, 4.07259705233212e-05, 3.62825448554739e-05, 
                        3.95854341194398e-05, 4.23930151174446e-05, 5.25472735118296e-05, 
                        5.76202168197769e-05, 5.23957149070388e-05, 4.31323519093776e-05, 
                        2.90350657890489e-05, 3.22693947104228e-05, 3.90988677457566e-05, 
                        4.44607200813546e-05, 4.28121839343577e-05, 4.28542288317551e-05, 
                        2.56149959419174e-05, 2.77652788697063e-05, 3.49302533009518e-05, 
                        4.13777396322285e-05, 4.12908495437265e-05, 3.92084109551252e-05, 
                        4.14887591359563e-05, 4.39273564362111e-05, 5.31197050290816e-05, 
                        5.77484133948985e-05, 5.36319646972061e-05, 4.62472643466539e-05, 
                        3.06756490605887e-05, 3.49917045844483e-05, 4.15936967740209e-05, 
                        4.66221720234964e-05, 4.48785430220286e-05, 4.44766996381653e-05, 
                        2.36916432633518e-05, 2.69248181080789e-05, 3.471280169582e-05, 
                        3.94762090257435e-05, 4.17765202936009e-05, 3.8021359310749e-05
), .Dim = c(6L, 3L, 5L))

This is a 3D array with 3 dimensions. The columns correspond to the study areas, and the rows to the "months" followed. The third dimension corresponds to the values of the simulation.

My question : Is it possible, with ggplot, to present a multipanel graph (grid) - 1 panel for 1 study area - of boxplots simulations (values of the 3rd dimension) with months at "x axis" please (= 6 boxplots per panel) ? I would also like to draw the lines of the values observed through the boxplots of each panel. Thank you !


Viewing all articles
Browse latest Browse all 201867

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>