#set folder path
setwd("/Users/jgodet/Documents/testMacro")

#read the 3 fitted peaks
dat <- read.csv("Fit.spectre.csv",h=T,dec='.')

mod <- lm(distZ0Z1 ~ lambda + X + Y, data=dat[dat$Use==1,])

#to check graphically
 with(dat[dat$Use==1,], plot(lambda,distZ0Z1))
 abline(col='red', lm(distZ0Z1~lambda, data= dat[dat$Use==1,]), lwd=2)
#4 coefficients for input in the macro GUI dialogbox
mod
