Let's assume I have a dataframe in the following format, obtained from a .csv file:
Measurement Config Value
--------------------------- _
Time A 10 |
Object A 20 | Run 1
Nodes A 30 _|
Time A 8 |
Object A 18 | Run 2
Nodes A 29 _|
Time B 9 |
Object B 20 | Run 3
Nodes B 35 _|
...
There are a fixed number of Measurements
that are taken during each run, and each run is run with a given Config
.
The Measurements
per run are fixed (e.g., every run consists of a Time, an Objects and a Nodes measurement in the example above), but there can be multiple runs for a single config (e.g., Config A
was run two times in the example above, B
only once)
My primary goal is to plot correlations (scatter plots) between two of those measurement types, e.g., plot Objects
(x-axis) against Nodes
(y-axis) and highlight different Configs
(color)
I thought that this could be best achieved if the dataframe is in the following format:
Config Time Objects Nodes
--------------------------
A 10 20 30 <- Run 1
A 8 18 29 <- Run 2
B 9 20 35 <- Run 3
I.e., creating the columns based on the factor-values of the Measurement
-column, and assigning the respective Value
-value to the cells.
Is there an "easy" way in R to achieve that?