Hi all, I have define a function Statistical_Catch_At_Age <- function(Cya,Mya,Fy,Sa) { ...... here there are the objects Cya,Mya,Fy,Sa and the most important of all is the next: fitting<-nls( formula=Cya ~ (Sa*Fy) / (Sa*Fy + Mya) * Nya * (1-exp( -( Sa*Fy + Mya ))), start = list( Fy = c(0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5) , Sa = c(0.2,0.3,0.4,0.5,0.5,0.6,0.6,0.6,0.5) ), data = list(Cya,Mya,Fy,Sa)) fitting summary(fitting) } The subscripts "y" represent rows and "a" columns But I get an error message: "Error in qr.qty(QR, resid) : qr and y must have the same number of rows" Help Luis Ridao Cruz Fiskiranns??knarstovan N??at??n 1 P.O. Box 3051 FR-110 T??rshavn Faroe Islands Phone: +298 353900 Phone(direct): +298 353912 Mobile: +298 580800 Fax: +298 353901 E-mail: luisr at frs.fo Web: www.frs.fo