[FLR-list] dim and dimnames in FLQuant
Leire Ibaibarriaga
libaibarriaga at azti.es
Mon Mar 27 08:55:43 CEST 2017
Hi,
I'm creating some Flquants using some code I have used with earlier R and FLCore versions but now when I specify both the dim and the dimnames, I get the following error
> FLQuant(1, dim=c(1,10,1,1,1,1), dimnames=list(year=2000:2009))
Error in array(as.double(object), dim = dim, dimnames = dimnames) :
length of 'dimnames' [1] not equal to array extent
Specifying only one of them seems to be fine
> FLQuant(1, dimnames=list(year=2000:2009))
An object of class "FLQuant"
, , unit = unique, season = all, area = unique
year
quant 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009
all 1 1 1 1 1 1 1 1 1 1
units: NA
> flq <- FLQuant(1, dim=c(1,10,1,1,1,1))
> dimnames(flq) <- list(year=2000:2009)
> flq
An object of class "FLQuant"
, , unit = unique, season = all, area = unique
year
quant 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009
all 1 1 1 1 1 1 1 1 1 1
units: NA
Is there a way to specify both within the FLQuant function? Thanks
leire
Below some info on my R session
> sessionInfo()
R version 3.3.3 (2017-03-06)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1
locale:
[1] LC_COLLATE=Spanish_Spain.1252 LC_CTYPE=Spanish_Spain.1252 LC_MONETARY=Spanish_Spain.1252
[4] LC_NUMERIC=C LC_TIME=Spanish_Spain.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] rjags_4-6 coda_0.19-1 FLBEIA_1.15 ggplot2_2.2.1 FLFleet_2.5.20150311
[6] FLCore_2.6.0.20170228 lattice_0.20-34 MASS_7.3-45
loaded via a namespace (and not attached):
[1] Rcpp_0.12.10 assertthat_0.1 grid_3.3.3 plyr_1.8.4 gtable_0.2.0 stats4_3.3.3
[7] scales_0.4.1 lazyeval_0.2.0 Matrix_1.2-8 tools_3.3.3 munsell_0.4.3 colorspace_1.3-2
[13] tibble_1.2
Leire Ibaibarriaga
Dr. / PhD. / Dk.
AZTI. Gestión Pesquera Sostenible. Sustainable Fisheries Management. Arrantza-kudeaketa Jasangarria
Txatxarramendi Ugartea z/g. E-48395 Sukarrieta - BIZKAIA (Spain)
T. +34 667 174 401 | Mail: libaibarriaga at azti.es<mailto:libaibarriaga at azti.es>
[cid:image002.jpg at 01D2A6D7.E3DE6CB0]
[cid:image003.jpg at 01D1CE1F.1DB675A0]
SEDE CENTRAL
Txatxarramendi Ugartea z/g
E-48395 Sukarrieta - BIZKAIA (Spain)
Parque Tecnológico de Bizkaia
Astondo Bidea, Edificio 609
E-48160 Derio - BIZKAIA (Spain)
Herrera Kaia - Portualdea z/g
E-20110 Pasaia - GIPUZKOA (Spain)
[cid:image004.jpg at 01D1CE1F.1DB675A0]
T. (+34) 946 574 000 / F. (+34) 946 572 555
[cid:image005.jpg at 01D1CE1F.1DB675A0]
E-mail: info at azti.es<mailto:info at azti.es>
[cid:image006.jpg at 01D1CE1F.1DB675A0]
www.azti.es<http://www.azti.es>
[cid:image007.jpg at 01D1CE1F.1DB675A0]
NEWSLETTERS<http://www.azti.es/es/newsletters/>
AVISO LEGAL. Este mensaje es personal y confidencial y su uso no autorizado está prohibido legalmente. Si usted no es el destinatario, proceda a borrarlo, sin reenviarlo ni conservarlo.
Por favor, piensa en el medio ambiente antes de imprimir.
DISCLAIMER. This message is personal and confidential, unauthorised use is legally prohibited. If you are not the intended recipient, delete it without resending or backing it.
Please, consider the environment before printing this email.
LEGE OHARRA. Mezu hau pertsonala eta isilpekoa da eta baimenik gabeko erabileradebekatua dago legalki. Jasotzailea ez bazara ezabatu mezua, bidali eta kontserbatu gabe.
Mesedez, pentsatu ingurugiroan inprimatu baino lehen.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/flr-list/attachments/20170327/affc4d14/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.jpg
Type: image/jpeg
Size: 20285 bytes
Desc: image001.jpg
URL: <http://lists.r-forge.r-project.org/pipermail/flr-list/attachments/20170327/affc4d14/attachment-0007.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image003.jpg
Type: image/jpeg
Size: 14699 bytes
Desc: image003.jpg
URL: <http://lists.r-forge.r-project.org/pipermail/flr-list/attachments/20170327/affc4d14/attachment-0008.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image004.jpg
Type: image/jpeg
Size: 2931 bytes
Desc: image004.jpg
URL: <http://lists.r-forge.r-project.org/pipermail/flr-list/attachments/20170327/affc4d14/attachment-0009.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image005.jpg
Type: image/jpeg
Size: 14782 bytes
Desc: image005.jpg
URL: <http://lists.r-forge.r-project.org/pipermail/flr-list/attachments/20170327/affc4d14/attachment-0010.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image006.jpg
Type: image/jpeg
Size: 2735 bytes
Desc: image006.jpg
URL: <http://lists.r-forge.r-project.org/pipermail/flr-list/attachments/20170327/affc4d14/attachment-0011.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image007.jpg
Type: image/jpeg
Size: 12189 bytes
Desc: image007.jpg
URL: <http://lists.r-forge.r-project.org/pipermail/flr-list/attachments/20170327/affc4d14/attachment-0012.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image002.jpg
Type: image/jpeg
Size: 3549 bytes
Desc: image002.jpg
URL: <http://lists.r-forge.r-project.org/pipermail/flr-list/attachments/20170327/affc4d14/attachment-0013.jpg>
More information about the flr-list
mailing list