[adegenet-forum] Hybridize Function / df2genind error message

Jombart, Thibaut t.jombart at imperial.ac.uk
Tue Nov 4 13:20:37 CET 2014


Hi Spencer,

you don't need to convert genind to data.frames - just subset individuals in the genind objects like you would in a matrix. Then, you can pool datasets with potentially different alleles using 'repool'.

Cheers
Thibaut
________________________________
From: adegenet-forum-bounces at lists.r-forge.r-project.org [adegenet-forum-bounces at lists.r-forge.r-project.org] on behalf of Spencer Bruce [goatsrunfaster at gmail.com]
Sent: 27 October 2014 13:57
To: adegenet-forum at lists.r-forge.r-project.org
Subject: [adegenet-forum] Hybridize Function / df2genind error message

Hello All,

After hybridizing two populations, I converted the genind file to at dataframe to randomly extract individuals. I then attempt to convert this data frame back into a genind file, but get the error message below:

> F1_G1 <- df2genind(randomF1)
Error in df2genind(randomF1) :
  2 alleles cannot be coded by a total of 19 characters

Im assuming this is because the "pop" column, instead of being coded by a number contains the text generated by the hybridize function "honnedaga-tdhybrids"

I tried to resolve this by using the following code, but ran into a second error message:

> randomF1$pop[randomF1$pop == "honnedaga-tdhybrids"] <- 1
Warning message:
In `[<-.factor`(`*tmp*`, randomF1$pop == "honnedaga-tdhybrids",  :
  invalid factor level, NA generated

any idea how I might be able to fix this? Thanks in advance!!!

-Spencer

--
Spencer A Bruce
200 Washington St.
Troy, NY 12180
518 225 0787
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/adegenet-forum/attachments/20141104/d7ff3a77/attachment.html>


More information about the adegenet-forum mailing list