I want to draw Boxplots of Measurement-Data grouped by a distance value. My csv
-File is like this:
distance;fp1;fp2;fp3;...;fp99
30;-54;-51;-45;...;-56
40;...
...
400;...
Now I want to draw Boxplots for each row with the value of fp1
-fp99
and the distance as x-Axis value, so that I have multiple boxplots for the different distance side by side ordered by their distance
.
Hope somebody can help me.
So here is a sample:
library(ggplot2)
library(reshape)
data <- read.csv(file='file.csv', head=TRUE, sep=';')
pdf(file="output.pdf", onefile=TRUE, pagecentre=TRUE, width=12, height=6)
data$group <- row.names(data)
data.m <- melt(data, id.vars = "group")
print(
ggplot(data.m, aes(group, value)) + geom_boxplot()
)
That produces this:
I want to exclude the distance
for the box plot and use it as x-coordinate. I hope you guys understand what I mean.