Hi, I am using adehabitatHS for habitat selection analysis using widesII(), when running the script I get the error message: Error in as.vector(X) %*% t(as.vector(Y)) : non-conformable arguments Here the script I am using including the data> #dataset (read from tab deliminated text file) > > availableRiparian Conifer MtShrub1 Aspen RockOutcrop Bitterbrush Windblown MtShrub2 PresBurn 1 0.06 0.13 0.16 0.15 0.06 0.17 0.12 0.04 0.09 Clearcut 1 0.02> usedRiparian Conifer MtShrub1 Aspen RockOutcrop Bitterbrush Windblown MtShrub2 PresBurn Ani1 0 0 0 2 0 16 5 14 28 Ani2 0 2 1 2 2 5 10 10 35 Ani3 0 1 2 1 0 14 9 8 40 Ani4 0 1 3 7 5 3 6 9 31 Ani5 0 0 2 2 5 18 10 6 25 Ani6 0 2 1 4 2 7 6 15 19 Clearcut Ani1 8 Ani2 9 Ani3 4 Ani4 9 Ani5 0 Ani6 19> > #analysis > > widesII(used, available, avknown = TRUE, alpha = 0.05)Error in as.vector(X) %*% t(as.vector(Y)) : non-conformable arguments Note: I am using an example dataset to test out a script I want to use to analyse my own dataset, for this I exported the example dataset to excel, converted it to tab deliminated text file, then imported it. All worked well when using the example dataset provided by adehabitatHS, thus I suspect that somhow my test dataset is not correctly read in or something similar. I am quite new to R, thus apologize for any shortcomings in reporting etc.. Many thanks, best, Alex -- View this message in context: http://r.789695.n4.nabble.com/ERROR-non-conformable-arguments-tp4712516.html Sent from the R help mailing list archive at Nabble.com. [[alternative HTML version deleted]]
To debug this kind of problem you really need to use dput() to provide the data
in your email. [1]
[1]
http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example
---------------------------------------------------------------------------
Jeff Newmiller The ..... ..... Go Live...
DCN:<jdnewmil at dcn.davis.ca.us> Basics: ##.#. ##.#. Live
Go...
Live: OO#.. Dead: OO#.. Playing
Research Engineer (Solar/Batteries O.O#. #.O#. with
/Software/Embedded Controllers) .OO#. .OO#. rocks...1k
---------------------------------------------------------------------------
Sent from my phone. Please excuse my brevity.
On September 20, 2015 12:03:54 AM PDT, "Alexander Mo?brucker"
<islandelephants at gmail.com> wrote:>Hi,
>
>I am using adehabitatHS for habitat selection analysis using widesII(),
>when
>running the script I get the error message: Error in as.vector(X) %*%
>t(as.vector(Y)) : non-conformable arguments
>
>Here the script I am using including the data
>
>> #dataset (read from tab deliminated text file)
>>
>> available
>Riparian Conifer MtShrub1 Aspen RockOutcrop Bitterbrush Windblown
>MtShrub2
>PresBurn
>1 0.06 0.13 0.16 0.15 0.06 0.17 0.12
>0.04
>0.09
> Clearcut
>1 0.02
>> used
> Riparian Conifer MtShrub1 Aspen RockOutcrop Bitterbrush Windblown
>MtShrub2 PresBurn
>Ani1 0 0 0 2 0 16 5
>14 28
>Ani2 0 2 1 2 2 5 10
>10 35
>Ani3 0 1 2 1 0 14 9
>8 40
>Ani4 0 1 3 7 5 3 6
>9 31
>Ani5 0 0 2 2 5 18 10
>6 25
>Ani6 0 2 1 4 2 7 6
>15 19
> Clearcut
>Ani1 8
>Ani2 9
>Ani3 4
>Ani4 9
>Ani5 0
>Ani6 19
>>
>> #analysis
>>
>> widesII(used, available, avknown = TRUE, alpha = 0.05)
>Error in as.vector(X) %*% t(as.vector(Y)) : non-conformable arguments
>
>Note: I am using an example dataset to test out a script I want to use
>to
>analyse my own dataset, for this I exported the example dataset to
>excel,
>converted it to tab deliminated text file, then imported it.
>
>All worked well when using the example dataset provided by
>adehabitatHS,
>thus I suspect that somhow my test dataset is not correctly read in or
>something similar.
>
>I am quite new to R, thus apologize for any shortcomings in reporting
>etc..
>
>Many thanks, best, Alex
>
>
>
>--
>View this message in context:
>http://r.789695.n4.nabble.com/ERROR-non-conformable-arguments-tp4712516.html
>Sent from the R help mailing list archive at Nabble.com.
>
> [[alternative HTML version deleted]]
>
>______________________________________________
>R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
>https://stat.ethz.ch/mailman/listinfo/r-help
>PLEASE do read the posting guide
>http://www.R-project.org/posting-guide.html
>and provide commented, minimal, self-contained, reproducible code.
Hi all, I am sorry I forgot to attach the excel file and txt files with the test data I used for this example..... I am almost sure the problem was caused by the way R is reading this data, Hope to get some help, best, Alex 2015-09-20 14:03 GMT+07:00 Alexander Mo?brucker <islandelephants at gmail.com>:> > Hi, > > I am using adehabitatHS for habitat selection analysis using widesII(), > when > running the script I get the error message: Error in as.vector(X) %*% > t(as.vector(Y)) : non-conformable arguments > > Here the script I am using including the data > > > #dataset (read from tab deliminated text file) > > > > available > Riparian Conifer MtShrub1 Aspen RockOutcrop Bitterbrush Windblown > MtShrub2 > PresBurn > 1 0.06 0.13 0.16 0.15 0.06 0.17 0.12 > 0.04 > 0.09 > Clearcut > 1 0.02 > > used > Riparian Conifer MtShrub1 Aspen RockOutcrop Bitterbrush Windblown > MtShrub2 PresBurn > Ani1 0 0 0 2 0 16 5 > 14 28 > Ani2 0 2 1 2 2 5 10 > 10 35 > Ani3 0 1 2 1 0 14 9 > 8 40 > Ani4 0 1 3 7 5 3 6 > 9 31 > Ani5 0 0 2 2 5 18 10 > 6 25 > Ani6 0 2 1 4 2 7 6 > 15 19 > Clearcut > Ani1 8 > Ani2 9 > Ani3 4 > Ani4 9 > Ani5 0 > Ani6 19 > > > > #analysis > > > > widesII(used, available, avknown = TRUE, alpha = 0.05) > Error in as.vector(X) %*% t(as.vector(Y)) : non-conformable arguments > > Note: I am using an example dataset to test out a script I want to use to > analyse my own dataset, for this I exported the example dataset to excel, > converted it to tab deliminated text file, then imported it. > > All worked well when using the example dataset provided by adehabitatHS, > thus I suspect that somhow my test dataset is not correctly read in or > something similar. > > I am quite new to R, thus apologize for any shortcomings in reporting etc.. > > Many thanks, best, Alex > > > > -- > View this message in context: > http://r.789695.n4.nabble.com/ERROR-non-conformable-arguments-tp4712516.html > Sent from the R help mailing list archive at Nabble.com. > > > >-------------- next part -------------- Riparian Conifer MtShrub1 Aspen RockOutcrop Bitterbrush Windblown MtShrub2 PresBurn Clearcut 0.06 0.13 0.16 0.15 0.06 0.17 0.12 0.04 0.09 0.02 -------------- next part -------------- Riparian Conifer MtShrub1 Aspen RockOutcrop Bitterbrush Windblown MtShrub2 PresBurn Clearcut Ani1 0 0 0 2 0 16 5 14 28 8 Ani2 0 2 1 2 2 5 10 10 35 9 Ani3 0 1 2 1 0 14 9 8 40 4 Ani4 0 1 3 7 5 3 6 9 31 9 Ani5 0 0 2 2 5 18 10 6 25 0 Ani6 0 2 1 4 2 7 6 15 19 19
Hi Do not use attachment, copy result of dput(object) to your mail instead. This enables us to see how your data really look like. I get different error.> widesII(used, available, avknown = TRUE, alpha = 0.05)Error in widesII(used, available, avknown = TRUE, alpha = 0.05) : used and available matrices should have the same number of habitats The error is due to fact that row names were read as column of data frame. After correcting this I got the same error as you.> widesII(used, available, avknown = TRUE, alpha = 0.05)Error in as.vector(X) %*% t(as.vector(Y)) : non-conformable arguments I checked the help page and I noticed that a for widesI and widesII, a vector with named elements describing the sample or the proportion of available resource units. For widesIII a matrix or a data frame giving the number or the proportion of available resource units for each animal (in rows) in each resource category (in columns) but your "available" is a data frame. When I change it to named vector (as required)> dput(avail)structure(c(0.06, 0.13, 0.16, 0.15, 0.06, 0.17, 0.12, 0.04, 0.09, 0.02), .Names = c("Riparian", "Conifer", "MtShrub1", "Aspen", "RockOutcrop", "Bitterbrush", "Windblown", "MtShrub2", "PresBurn", "Clearcut")) widesII came with result without complain.> widesII(used, avail, avknown = TRUE, alpha = 0.05)************** Manly's Selection ratios for design II ******** 1. Test of identical use of habitat by all animals (Classical Khi-2 performed on the used matrix): Khi2L1 df pvalue So the lesson is: 1. Read the help page. 2. Look to your data by ?str 3. When your data are as expected by the function, check if there is no syntax problem. 4. Try to simplify the example and send it to help list preferably by ?dput. Cheers Petr> -----Original Message----- > From: R-help [mailto:r-help-bounces at r-project.org] On Behalf Of > Alexander Mo?brucker > Sent: Monday, September 21, 2015 8:58 AM > To: r-help at r-project.org; jdnewmil at dcn.davis.ca.us > Subject: Re: [R] ERROR - non-conformable arguments > > Hi all, > > I am sorry I forgot to attach the excel file and txt files with the > test data I used for this example..... > > I am almost sure the problem was caused by the way R is reading this > data, > > Hope to get some help, best, Alex > > 2015-09-20 14:03 GMT+07:00 Alexander Mo?brucker > <islandelephants at gmail.com>: > > > > > Hi, > > > > I am using adehabitatHS for habitat selection analysis using > > widesII(), when running the script I get the error message: Error in > > as.vector(X) %*% > > t(as.vector(Y)) : non-conformable arguments > > > > Here the script I am using including the data > > > > > #dataset (read from tab deliminated text file) > > > > > > available > > Riparian Conifer MtShrub1 Aspen RockOutcrop Bitterbrush Windblown > > MtShrub2 > > PresBurn > > 1 0.06 0.13 0.16 0.15 0.06 0.17 0.12 > > 0.04 > > 0.09 > > Clearcut > > 1 0.02 > > > used > > Riparian Conifer MtShrub1 Aspen RockOutcrop Bitterbrush > Windblown > > MtShrub2 PresBurn > > Ani1 0 0 0 2 0 16 > 5 > > 14 28 > > Ani2 0 2 1 2 2 5 > 10 > > 10 35 > > Ani3 0 1 2 1 0 14 > 9 > > 8 40 > > Ani4 0 1 3 7 5 3 > 6 > > 9 31 > > Ani5 0 0 2 2 5 18 > 10 > > 6 25 > > Ani6 0 2 1 4 2 7 > 6 > > 15 19 > > Clearcut > > Ani1 8 > > Ani2 9 > > Ani3 4 > > Ani4 9 > > Ani5 0 > > Ani6 19 > > > > > > #analysis > > > > > > widesII(used, available, avknown = TRUE, alpha = 0.05) > > Error in as.vector(X) %*% t(as.vector(Y)) : non-conformable arguments > > > > Note: I am using an example dataset to test out a script I want to > use > > to analyse my own dataset, for this I exported the example dataset to > > excel, converted it to tab deliminated text file, then imported it. > > > > All worked well when using the example dataset provided by > > adehabitatHS, thus I suspect that somhow my test dataset is not > > correctly read in or something similar. > > > > I am quite new to R, thus apologize for any shortcomings in reporting > etc.. > > > > Many thanks, best, Alex > > > > > > > > -- > > View this message in context: > > http://r.789695.n4.nabble.com/ERROR-non-conformable-arguments- > tp471251 > > 6.html Sent from the R help mailing list archive at Nabble.com. > > > > > > > >________________________________ Tento e-mail a jak?koliv k n?mu p?ipojen? dokumenty jsou d?v?rn? a jsou ur?eny pouze jeho adres?t?m. Jestli?e jste obdr?el(a) tento e-mail omylem, informujte laskav? neprodlen? jeho odes?latele. Obsah tohoto emailu i s p??lohami a jeho kopie vyma?te ze sv?ho syst?mu. Nejste-li zam??len?m adres?tem tohoto emailu, nejste opr?vn?ni tento email jakkoliv u??vat, roz?i?ovat, kop?rovat ?i zve?ej?ovat. Odes?latel e-mailu neodpov?d? za eventu?ln? ?kodu zp?sobenou modifikacemi ?i zpo?d?n?m p?enosu e-mailu. V p??pad?, ?e je tento e-mail sou??st? obchodn?ho jedn?n?: - vyhrazuje si odes?latel pr?vo ukon?it kdykoliv jedn?n? o uzav?en? smlouvy, a to z jak?hokoliv d?vodu i bez uveden? d?vodu. - a obsahuje-li nab?dku, je adres?t opr?vn?n nab?dku bezodkladn? p?ijmout; Odes?latel tohoto e-mailu (nab?dky) vylu?uje p?ijet? nab?dky ze strany p??jemce s dodatkem ?i odchylkou. - trv? odes?latel na tom, ?e p??slu?n? smlouva je uzav?ena teprve v?slovn?m dosa?en?m shody na v?ech jej?ch n?le?itostech. - odes?latel tohoto emailu informuje, ?e nen? opr?vn?n uzav?rat za spole?nost ??dn? smlouvy s v?jimkou p??pad?, kdy k tomu byl p?semn? zmocn?n nebo p?semn? pov??en a takov? pov??en? nebo pln? moc byly adres?tovi tohoto emailu p??padn? osob?, kterou adres?t zastupuje, p?edlo?eny nebo jejich existence je adres?tovi ?i osob? j?m zastoupen? zn?m?. This e-mail and any documents attached to it may be confidential and are intended only for its intended recipients. If you received this e-mail by mistake, please immediately inform its sender. Delete the contents of this e-mail with all attachments and its copies from your system. If you are not the intended recipient of this e-mail, you are not authorized to use, disseminate, copy or disclose this e-mail in any manner. The sender of this e-mail shall not be liable for any possible damage caused by modifications of the e-mail or by delay with transfer of the email. In case that this e-mail forms part of business dealings: - the sender reserves the right to end negotiations about entering into a contract in any time, for any reason, and without stating any reasoning. - if the e-mail contains an offer, the recipient is entitled to immediately accept such offer; The sender of this e-mail (offer) excludes any acceptance of the offer on the part of the recipient containing any amendment or variation. - the sender insists on that the respective contract is concluded only upon an express mutual agreement on all its aspects. - the sender of this e-mail informs that he/she is not authorized to enter into any contracts on behalf of the company except for cases in which he/she is expressly authorized to do so in writing, and such authorization or power of attorney is submitted to the recipient or the person represented by the recipient, or the existence of such authorization is known to the recipient of the person represented by the recipient.