flr/FLCore

as.FLQuant(data.frame) should only alter the dimanmes added in dimnames=

iagomosqueira opened this issue · 3 comments

If a data.frame with year,data is converted using

dfs <- as.FLQuant(dat, units="", dimnames=list(age=0))

The year dimnames are reset by the dimnames argument.

Sir i want convert length to age per year i have this problem
I have length start from 5 to 23.5 with step 0.5 and 11 years from 2008 to 2019
Landings.n.flq <- FLQuant(Landings.n.matrix ,dimnames=list(len=seq(5,23.5,by=0.5), year = 2008:2018))
Error in array(object, dim = dim, dimnames = filldimnames(dimnames, dim = dim)) :
length of 'dimnames' [2] not equal to array extent

Without seeing the matrix, I notice you say it goes from 2008 to 2019, but the call to FLQuant() gives dimnames as year=2008:2018. The error says the length of dimension 2 (year) and dimnames[2] do not match.

thank you so match