[adegenet-forum] Problems with genind object

Thibaut Jombart thibautjombart at gmail.com
Fri Nov 3 16:19:57 CET 2017


I suspect your issue is that pop(x) is NULL. This is because you do
not set it up when creating the genind object. You can add it by
reading this data into R, and then using

pop(Hex) <- your_pop_factor

Best
Thibaut

--
Dr Thibaut Jombart
Lecturer, Department of Infectious Disease Epidemiology, Imperial College London
Head of RECON: repidemicsconsortium.org
WHO Consultant - outbreak analysis
sites.google.com/site/thibautjombart/
Twitter: @TeebzR
+44(0)20 7594 3658


On 3 November 2017 at 13:47, Logan Clark <clarklc at appstate.edu> wrote:
> My code so far has been
> Hexas<- read.csv(Hexastylis1)
> Hexa<- data.frame(Hexas)
> Hex<- df2genind(Hexas, sep="/")
> HexBoot<- chao_bootstrap(Hex, n=1000)
> Error in tapply(y, pop(x), mean, na.rm = TRUE) :
>   arguments must have same length
>
> I also included a subset of the data. Thank you for your help, I really
> appreciate it. I am still new to R and learning the ropes.
>
> On Fri, Nov 3, 2017 at 8:37 AM, Thibaut Jombart <thibautjombart at gmail.com>
> wrote:
>>
>> Yes, we need more information. We don't know what 'y' is here, or what
>> command line you called in the first place.
>>
>> Best
>> Thibaut
>>
>> --
>> Dr Thibaut Jombart
>> Lecturer, Department of Infectious Disease Epidemiology, Imperial College
>> London
>> Head of RECON: repidemicsconsortium.org
>> WHO Consultant - outbreak analysis
>> sites.google.com/site/thibautjombart/
>> Twitter: @TeebzR
>> +44(0)20 7594 3658
>>
>>
>> On 3 November 2017 at 08:12, Roman Luštrik <roman.lustrik at biolitika.si>
>> wrote:
>> > Can you provide a small example we can work on?
>> >
>> > Cheers,
>> > Roman
>> >
>> > ----
>> > In god we trust, all others bring data.
>> >> Zahtevaj IJZ na https://kurc.biolitika.si
>> >
>> > ________________________________
>> > From: "Logan Clark" <clarklc at appstate.edu>
>> > To: adegenet-forum at lists.r-forge.r-project.org
>> > Sent: Thursday, November 2, 2017 8:10:03 PM
>> > Subject: [adegenet-forum] Problems with genind object
>> >
>> > Hi, I am working on a project involving microsatellite data in a
>> > relatively
>> > standard diploid species. I have 141 samples across 17 loci and my
>> > alleles
>> > formatted as 168/184 for a heterozygote and 168/168 for a homozygote. I
>> > have
>> > been able to transfer my data from a .csv file to a dataframe then to a
>> > genind object using df2genind. I have been able to run other statistics
>> > on
>> > the genind object I have created such as HWE, but I am trying to use the
>> > chao_bootstrap function in mmod with this object and I keep getting the
>> > error message
>> >  "Error in tapply(y, pop(x), mean, na.rm = TRUE) :
>> >   arguments must have same length"
>> >
>> > I'm not really sure what this means or how to fix it. I am trying to run
>> > the
>> > individuals as one population, but I am not sure if that is have any
>> > effect.
>> > Should I create another vector of 1's to code for the population and
>> > concatenate the two? Does anyone have any advice on how to solve this
>> > problem? Thank you in advance for any help with this issue.
>> >
>> > --
>> > Logan Clark
>> > Graduate Student
>> > Biology Department
>> > Appalachian State University
>> > P: 252-370-0034
>> > E: clarklc at appstate.edu
>> >
>> >
>> > _______________________________________________
>> > adegenet-forum mailing list
>> > adegenet-forum at lists.r-forge.r-project.org
>> >
>> > https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/adegenet-forum
>> >
>> > _______________________________________________
>> > adegenet-forum mailing list
>> > adegenet-forum at lists.r-forge.r-project.org
>> >
>> > https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/adegenet-forum
>
>
>
>
> --
> Logan Clark
> Graduate Student
> Biology Department
> Appalachian State University
> P: 252-370-0034
> E: clarklc at appstate.edu
>


More information about the adegenet-forum mailing list