[FLR-list] dim and dimnames in FLQuant
Iago.MOSQUEIRA at ec.europa.eu
Iago.MOSQUEIRA at ec.europa.eu
Tue May 30 11:32:31 CEST 2017
Hi,
This has now been fixed, at least for vector inputs, did not seem to be a problem when an array was passed, but obviously then the dim of the array, and the values in dim and dimnames must all match.
https://github.com/flr/FLCore/commit/3df3457632255e4ccda621165437a3cf5fdd2523
I still think using only dimnames is a safer option
Best,
Iago
--
Dr Iago Mosqueira
European Commission
DG Joint Research Centre
Directorate D - Sustainable Resources
Unit D.02 Water and Marine Resources
TP 051, Via Enrico Fermi 2749
I-21027 Ispra (VA), Italy
Phone : +39 0332 785413
iago.mosqueira at ec.europa.eu
________________________________
From: flr-list-bounces at lists.r-forge.r-project.org [flr-list-bounces at lists.r-forge.r-project.org] on behalf of Iago.MOSQUEIRA at ec.europa.eu [Iago.MOSQUEIRA at ec.europa.eu]
Sent: 30 May 2017 11:01
To: flr-list at flr-project.org
Subject: Re: [FLR-list] dim and dimnames in FLQuant
Hi,
I will check why the problem when passing both, but why do you need to do so? FLQuant() will follow dimnames when given and using it for dim too. Passing only one of them minimizes errors, for example if you change one argument but not the other
Iago
--
Dr Iago Mosqueira
European Commission
DG Joint Research Centre
Directorate D - Sustainable Resources
Unit D.02 Water and Marine Resources
TP 051, Via Enrico Fermi 2749
I-21027 Ispra (VA), Italy
Phone : +39 0332 785413
iago.mosqueira at ec.europa.eu
________________________________
From: flr-list-bounces at lists.r-forge.r-project.org [flr-list-bounces at lists.r-forge.r-project.org] on behalf of Leire Ibaibarriaga [libaibarriaga at azti.es]
Sent: 27 March 2017 08:55
To: flr-list at flr-project.org
Subject: [FLR-list] dim and dimnames in FLQuant
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/20170530/8a7d6173/attachment-0001.html>
-------------- 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/20170530/8a7d6173/attachment-0006.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/20170530/8a7d6173/attachment-0007.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/20170530/8a7d6173/attachment-0008.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/20170530/8a7d6173/attachment-0009.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/20170530/8a7d6173/attachment-0010.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/20170530/8a7d6173/attachment-0011.jpg>
More information about the flr-list
mailing list