An example filename.csv
distance;fp1;fp2;fp3;fp99
30;-54;-51;-45;-56
40;-30;-40;-40;-50
Here's a solution:
# read data
dat <- read.csv2("filename.csv")
# reshape data
library(reshape2)
dat_m <- melt(dat, id.vars = "distance")
# plot data
boxplot(value ~ distance, dat_m)
If you prefer ggplot2
, you can use:
library(ggplot2)
ggplot(dat_m, aes(x = as.factor(distance), y = value)) +
geom_boxplot()