<div dir="ltr"><div class="gmail_default" style="font-family:courier new,monospace;font-size:small">Hi,<br>I think that the problem is that since a genind object is a list, the nrow is NULL.<br><br></div><div class="gmail_default" style="font-family:courier new,monospace;font-size:small">Probably you want to sample from object$tab instead.<br><br></div><div class="gmail_default" style="font-family:courier new,monospace;font-size:small">Hope it helps.<br><br></div><div class="gmail_default" style="font-family:courier new,monospace;font-size:small">Best<br></div><div class="gmail_default" style="font-family:courier new,monospace;font-size:small"><br><br></div></div><div class="gmail_extra"><br clear="all"><div><div dir="ltr"><span style="font-family:courier new,monospace">Francesco Montinaro</span></div></div>
<br><div class="gmail_quote">On 23 October 2014 16:04,  <span dir="ltr"><<a href="mailto:adegenet-forum-request@lists.r-forge.r-project.org" target="_blank">adegenet-forum-request@lists.r-forge.r-project.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Send adegenet-forum mailing list submissions to<br>
        <a href="mailto:adegenet-forum@lists.r-forge.r-project.org">adegenet-forum@lists.r-forge.r-project.org</a><br>
<br>
To subscribe or unsubscribe via the World Wide Web, visit<br>
        <a href="https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/adegenet-forum" target="_blank">https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/adegenet-forum</a><br>
<br>
or, via email, send a message with subject or body 'help' to<br>
        <a href="mailto:adegenet-forum-request@lists.r-forge.r-project.org">adegenet-forum-request@lists.r-forge.r-project.org</a><br>
<br>
You can reach the person managing the list at<br>
        <a href="mailto:adegenet-forum-owner@lists.r-forge.r-project.org">adegenet-forum-owner@lists.r-forge.r-project.org</a><br>
<br>
When replying, please edit your Subject line so it is more specific<br>
than "Re: Contents of adegenet-forum digest..."<br>
<br>
<br>
Today's Topics:<br>
<br>
   1. repooling random rows from genind objects (Spencer Bruce)<br>
   2. Re: repooling random rows from genind objects (Jombart, Thibaut)<br>
   3. Re: repooling random rows from genind objects (Spencer Bruce)<br>
   4. Re: repooling random rows from genind objects (Jombart, Thibaut)<br>
   5. Re: repooling random rows from genind objects (Spencer Bruce)<br>
<br>
<br>
----------------------------------------------------------------------<br>
<br>
Message: 1<br>
Date: Thu, 23 Oct 2014 10:29:10 -0400<br>
From: Spencer Bruce <<a href="mailto:goatsrunfaster@gmail.com">goatsrunfaster@gmail.com</a>><br>
To: <a href="mailto:adegenet-forum@lists.r-forge.r-project.org">adegenet-forum@lists.r-forge.r-project.org</a><br>
Subject: [adegenet-forum] repooling random rows from genind objects<br>
Message-ID:<br>
        <CAGjKGeaQyQ=<a href="mailto:UFFOSerHR1qeKXHSwVzF-0whQf2do83wOV38s5w@mail.gmail.com">UFFOSerHR1qeKXHSwVzF-0whQf2do83wOV38s5w@mail.gmail.com</a>><br>
Content-Type: text/plain; charset="utf-8"<br>
<br>
Hello All!<br>
<br>
I have three seperate populations as genind objects. What I would like to<br>
do is pull a certain number of random individuals from each, to form a new<br>
single genind population.<br>
<br>
I would then like individuals from this new genind population to mate<br>
randomly, producing another genind object which would contain their<br>
offspring.<br>
<br>
Below is the code I came up with (which does not work):<br>
<br>
Year1 <- repool(F1[sample(nrow(F1), 500), ], pop1[sample(nrow(pop1), 750),<br>
], pop2[sample(nrow(pop2), 750), ], n=2000)<br>
<br>
Year2 <- hybridize(Year1[sample(nrow(Year1), 1000), ],<br>
Year1[sample(nrow(Year1), 1000), ], n=2000)<br>
<br>
<br>
any help would be greatly appreciated!<br>
<br>
Best,<br>
Spencer<br>
<br>
--<br>
Spencer A Bruce<br>
200 Washington St.<br>
Troy, NY 12180<br>
518 225 0787<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <<a href="http://lists.r-forge.r-project.org/pipermail/adegenet-forum/attachments/20141023/cb94a767/attachment-0001.html" target="_blank">http://lists.r-forge.r-project.org/pipermail/adegenet-forum/attachments/20141023/cb94a767/attachment-0001.html</a>><br>
<br>
------------------------------<br>
<br>
Message: 2<br>
Date: Thu, 23 Oct 2014 14:50:24 +0000<br>
From: "Jombart, Thibaut" <<a href="mailto:t.jombart@imperial.ac.uk">t.jombart@imperial.ac.uk</a>><br>
To: Spencer Bruce <<a href="mailto:goatsrunfaster@gmail.com">goatsrunfaster@gmail.com</a>>,<br>
        "<a href="mailto:adegenet-forum@lists.r-forge.r-project.org">adegenet-forum@lists.r-forge.r-project.org</a>"<br>
        <<a href="mailto:adegenet-forum@lists.r-forge.r-project.org">adegenet-forum@lists.r-forge.r-project.org</a>><br>
Subject: Re: [adegenet-forum] repooling random rows from genind<br>
        objects<br>
Message-ID:<br>
        <<a href="mailto:2CB2DA8E426F3541AB1907F98ABA6570ABE6AE7F@icexch-m1.ic.ac.uk">2CB2DA8E426F3541AB1907F98ABA6570ABE6AE7F@icexch-m1.ic.ac.uk</a>><br>
Content-Type: text/plain; charset="iso-8859-1"<br>
<br>
<br>
Hello,<br>
hard to figure out what is wrong without the error message..<br>
Cheers<br>
Thibaut<br>
________________________________<br>
From: <a href="mailto:adegenet-forum-bounces@lists.r-forge.r-project.org">adegenet-forum-bounces@lists.r-forge.r-project.org</a> [<a href="mailto:adegenet-forum-bounces@lists.r-forge.r-project.org">adegenet-forum-bounces@lists.r-forge.r-project.org</a>] on behalf of Spencer Bruce [<a href="mailto:goatsrunfaster@gmail.com">goatsrunfaster@gmail.com</a>]<br>
Sent: 23 October 2014 15:29<br>
To: <a href="mailto:adegenet-forum@lists.r-forge.r-project.org">adegenet-forum@lists.r-forge.r-project.org</a><br>
Subject: [adegenet-forum] repooling random rows from genind objects<br>
<br>
Hello All!<br>
<br>
I have three seperate populations as genind objects. What I would like to do is pull a certain number of random individuals from each, to form a new single genind population.<br>
<br>
I would then like individuals from this new genind population to mate randomly, producing another genind object which would contain their offspring.<br>
<br>
Below is the code I came up with (which does not work):<br>
<br>
Year1 <- repool(F1[sample(nrow(F1), 500), ], pop1[sample(nrow(pop1), 750), ], pop2[sample(nrow(pop2), 750), ], n=2000)<br>
<br>
Year2 <- hybridize(Year1[sample(nrow(Year1), 1000), ], Year1[sample(nrow(Year1), 1000), ], n=2000)<br>
<br>
<br>
any help would be greatly appreciated!<br>
<br>
Best,<br>
Spencer<br>
<br>
--<br>
Spencer A Bruce<br>
200 Washington St.<br>
Troy, NY 12180<br>
518 225 0787<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <<a href="http://lists.r-forge.r-project.org/pipermail/adegenet-forum/attachments/20141023/c43c29fe/attachment-0001.html" target="_blank">http://lists.r-forge.r-project.org/pipermail/adegenet-forum/attachments/20141023/c43c29fe/attachment-0001.html</a>><br>
<br>
------------------------------<br>
<br>
Message: 3<br>
Date: Thu, 23 Oct 2014 10:52:59 -0400<br>
From: Spencer Bruce <<a href="mailto:goatsrunfaster@gmail.com">goatsrunfaster@gmail.com</a>><br>
To: "Jombart, Thibaut" <<a href="mailto:t.jombart@imperial.ac.uk">t.jombart@imperial.ac.uk</a>><br>
Cc: "<a href="mailto:adegenet-forum@lists.r-forge.r-project.org">adegenet-forum@lists.r-forge.r-project.org</a>"<br>
        <<a href="mailto:adegenet-forum@lists.r-forge.r-project.org">adegenet-forum@lists.r-forge.r-project.org</a>><br>
Subject: Re: [adegenet-forum] repooling random rows from genind<br>
        objects<br>
Message-ID:<br>
        <<a href="mailto:CAGjKGeZhjLhurZbKiMZxSmZV_GFC3quw58FPt06LrXwakRDPeA@mail.gmail.com">CAGjKGeZhjLhurZbKiMZxSmZV_GFC3quw58FPt06LrXwakRDPeA@mail.gmail.com</a>><br>
Content-Type: text/plain; charset="utf-8"<br>
<br>
Error message:<br>
<br>
Error in <a href="http://sample.int" target="_blank">sample.int</a>(length(x), size, replace, prob) :<br>
  invalid first argument<br>
<br>
On Thu, Oct 23, 2014 at 10:50 AM, Jombart, Thibaut <<a href="mailto:t.jombart@imperial.ac.uk">t.jombart@imperial.ac.uk</a><br>
> wrote:<br>
<br>
><br>
> Hello,<br>
> hard to figure out what is wrong without the error message..<br>
> Cheers<br>
> Thibaut<br>
>  ------------------------------<br>
> *From:* <a href="mailto:adegenet-forum-bounces@lists.r-forge.r-project.org">adegenet-forum-bounces@lists.r-forge.r-project.org</a> [<br>
> <a href="mailto:adegenet-forum-bounces@lists.r-forge.r-project.org">adegenet-forum-bounces@lists.r-forge.r-project.org</a>] on behalf of Spencer<br>
> Bruce [<a href="mailto:goatsrunfaster@gmail.com">goatsrunfaster@gmail.com</a>]<br>
> *Sent:* 23 October 2014 15:29<br>
> *To:* <a href="mailto:adegenet-forum@lists.r-forge.r-project.org">adegenet-forum@lists.r-forge.r-project.org</a><br>
> *Subject:* [adegenet-forum] repooling random rows from genind objects<br>
><br>
>   Hello All!<br>
><br>
>  I have three seperate populations as genind objects. What I would like<br>
> to do is pull a certain number of random individuals from each, to form a<br>
> new single genind population.<br>
><br>
>  I would then like individuals from this new genind population to mate<br>
> randomly, producing another genind object which would contain their<br>
> offspring.<br>
><br>
>  Below is the code I came up with (which does not work):<br>
><br>
>  Year1 <- repool(F1[sample(nrow(F1), 500), ], pop1[sample(nrow(pop1),<br>
> 750), ], pop2[sample(nrow(pop2), 750), ], n=2000)<br>
><br>
>  Year2 <- hybridize(Year1[sample(nrow(Year1), 1000), ],<br>
> Year1[sample(nrow(Year1), 1000), ], n=2000)<br>
><br>
><br>
>  any help would be greatly appreciated!<br>
><br>
>  Best,<br>
> Spencer<br>
><br>
>  --<br>
> Spencer A Bruce<br>
> 200 Washington St.<br>
> Troy, NY 12180<br>
> 518 225 0787<br>
><br>
<br>
<br>
<br>
--<br>
Spencer A Bruce<br>
200 Washington St.<br>
Troy, NY 12180<br>
518 225 0787<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <<a href="http://lists.r-forge.r-project.org/pipermail/adegenet-forum/attachments/20141023/19bc54c8/attachment-0001.html" target="_blank">http://lists.r-forge.r-project.org/pipermail/adegenet-forum/attachments/20141023/19bc54c8/attachment-0001.html</a>><br>
<br>
------------------------------<br>
<br>
Message: 4<br>
Date: Thu, 23 Oct 2014 14:54:53 +0000<br>
From: "Jombart, Thibaut" <<a href="mailto:t.jombart@imperial.ac.uk">t.jombart@imperial.ac.uk</a>><br>
To: Spencer Bruce <<a href="mailto:goatsrunfaster@gmail.com">goatsrunfaster@gmail.com</a>><br>
Cc: "<a href="mailto:adegenet-forum@lists.r-forge.r-project.org">adegenet-forum@lists.r-forge.r-project.org</a>"<br>
        <<a href="mailto:adegenet-forum@lists.r-forge.r-project.org">adegenet-forum@lists.r-forge.r-project.org</a>><br>
Subject: Re: [adegenet-forum] repooling random rows from genind<br>
        objects<br>
Message-ID:<br>
        <<a href="mailto:2CB2DA8E426F3541AB1907F98ABA6570ABE6AE93@icexch-m1.ic.ac.uk">2CB2DA8E426F3541AB1907F98ABA6570ABE6AE93@icexch-m1.ic.ac.uk</a>><br>
Content-Type: text/plain; charset="iso-8859-1"<br>
<br>
<br>
<br>
What does nrow(F1) and other nrow(...)'s say?<br>
<br>
<br>
<br>
<br>
________________________________<br>
From: Spencer Bruce [<a href="mailto:goatsrunfaster@gmail.com">goatsrunfaster@gmail.com</a>]<br>
Sent: 23 October 2014 15:52<br>
To: Jombart, Thibaut<br>
Cc: <a href="mailto:adegenet-forum@lists.r-forge.r-project.org">adegenet-forum@lists.r-forge.r-project.org</a><br>
Subject: Re: [adegenet-forum] repooling random rows from genind objects<br>
<br>
Error message:<br>
<br>
Error in <a href="http://sample.int" target="_blank">sample.int</a><<a href="http://sample.int" target="_blank">http://sample.int</a>>(length(x), size, replace, prob) :<br>
  invalid first argument<br>
<br>
On Thu, Oct 23, 2014 at 10:50 AM, Jombart, Thibaut <<a href="mailto:t.jombart@imperial.ac.uk">t.jombart@imperial.ac.uk</a><mailto:<a href="mailto:t.jombart@imperial.ac.uk">t.jombart@imperial.ac.uk</a>>> wrote:<br>
<br>
Hello,<br>
hard to figure out what is wrong without the error message..<br>
Cheers<br>
Thibaut<br>
________________________________<br>
From: <a href="mailto:adegenet-forum-bounces@lists.r-forge.r-project.org">adegenet-forum-bounces@lists.r-forge.r-project.org</a><mailto:<a href="mailto:adegenet-forum-bounces@lists.r-forge.r-project.org">adegenet-forum-bounces@lists.r-forge.r-project.org</a>> [<a href="mailto:adegenet-forum-bounces@lists.r-forge.r-project.org">adegenet-forum-bounces@lists.r-forge.r-project.org</a><mailto:<a href="mailto:adegenet-forum-bounces@lists.r-forge.r-project.org">adegenet-forum-bounces@lists.r-forge.r-project.org</a>>] on behalf of Spencer Bruce [<a href="mailto:goatsrunfaster@gmail.com">goatsrunfaster@gmail.com</a><mailto:<a href="mailto:goatsrunfaster@gmail.com">goatsrunfaster@gmail.com</a>>]<br>
Sent: 23 October 2014 15:29<br>
To: <a href="mailto:adegenet-forum@lists.r-forge.r-project.org">adegenet-forum@lists.r-forge.r-project.org</a><mailto:<a href="mailto:adegenet-forum@lists.r-forge.r-project.org">adegenet-forum@lists.r-forge.r-project.org</a>><br>
Subject: [adegenet-forum] repooling random rows from genind objects<br>
<br>
Hello All!<br>
<br>
I have three seperate populations as genind objects. What I would like to do is pull a certain number of random individuals from each, to form a new single genind population.<br>
<br>
I would then like individuals from this new genind population to mate randomly, producing another genind object which would contain their offspring.<br>
<br>
Below is the code I came up with (which does not work):<br>
<br>
Year1 <- repool(F1[sample(nrow(F1), 500), ], pop1[sample(nrow(pop1), 750), ], pop2[sample(nrow(pop2), 750), ], n=2000)<br>
<br>
Year2 <- hybridize(Year1[sample(nrow(Year1), 1000), ], Year1[sample(nrow(Year1), 1000), ], n=2000)<br>
<br>
<br>
any help would be greatly appreciated!<br>
<br>
Best,<br>
Spencer<br>
<br>
--<br>
Spencer A Bruce<br>
200 Washington St.<br>
Troy, NY 12180<br>
518 225 0787<tel:518%20225%200787><br>
<br>
<br>
<br>
--<br>
Spencer A Bruce<br>
200 Washington St.<br>
Troy, NY 12180<br>
518 225 0787<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <<a href="http://lists.r-forge.r-project.org/pipermail/adegenet-forum/attachments/20141023/2dfd9408/attachment-0001.html" target="_blank">http://lists.r-forge.r-project.org/pipermail/adegenet-forum/attachments/20141023/2dfd9408/attachment-0001.html</a>><br>
<br>
------------------------------<br>
<br>
Message: 5<br>
Date: Thu, 23 Oct 2014 11:03:54 -0400<br>
From: Spencer Bruce <<a href="mailto:goatsrunfaster@gmail.com">goatsrunfaster@gmail.com</a>><br>
To: "Jombart, Thibaut" <<a href="mailto:t.jombart@imperial.ac.uk">t.jombart@imperial.ac.uk</a>><br>
Cc: "<a href="mailto:adegenet-forum@lists.r-forge.r-project.org">adegenet-forum@lists.r-forge.r-project.org</a>"<br>
        <<a href="mailto:adegenet-forum@lists.r-forge.r-project.org">adegenet-forum@lists.r-forge.r-project.org</a>><br>
Subject: Re: [adegenet-forum] repooling random rows from genind<br>
        objects<br>
Message-ID:<br>
        <<a href="mailto:CAGjKGeZiyS-27oF2CKb6JBPgS%2BVSyTA1-NS2Q8g2UC0JqOs4VA@mail.gmail.com">CAGjKGeZiyS-27oF2CKb6JBPgS+VSyTA1-NS2Q8g2UC0JqOs4VA@mail.gmail.com</a>><br>
Content-Type: text/plain; charset="utf-8"<br>
<br>
they both say Null, if I just type them into R.<br>
<br>
Just to be clear these genind objects contains microsat data for 11 loci<br>
for thousands of individuals.<br>
<br>
I'm rather new to R, so I apologize if I'm missing something obvious here...<br>
<br>
On Thu, Oct 23, 2014 at 10:54 AM, Jombart, Thibaut <<a href="mailto:t.jombart@imperial.ac.uk">t.jombart@imperial.ac.uk</a><br>
> wrote:<br>
<br>
><br>
><br>
>  What does nrow(F1) and other nrow(...)'s say?<br>
><br>
><br>
><br>
><br>
>   ------------------------------<br>
> *From:* Spencer Bruce [<a href="mailto:goatsrunfaster@gmail.com">goatsrunfaster@gmail.com</a>]<br>
> *Sent:* 23 October 2014 15:52<br>
> *To:* Jombart, Thibaut<br>
> *Cc:* <a href="mailto:adegenet-forum@lists.r-forge.r-project.org">adegenet-forum@lists.r-forge.r-project.org</a><br>
> *Subject:* Re: [adegenet-forum] repooling random rows from genind objects<br>
><br>
>   Error message:<br>
><br>
>  Error in <a href="http://sample.int" target="_blank">sample.int</a>(length(x), size, replace, prob) :<br>
>   invalid first argument<br>
><br>
> On Thu, Oct 23, 2014 at 10:50 AM, Jombart, Thibaut <<br>
> <a href="mailto:t.jombart@imperial.ac.uk">t.jombart@imperial.ac.uk</a>> wrote:<br>
><br>
>><br>
>> Hello,<br>
>> hard to figure out what is wrong without the error message..<br>
>> Cheers<br>
>> Thibaut<br>
>>  ------------------------------<br>
>> *From:* <a href="mailto:adegenet-forum-bounces@lists.r-forge.r-project.org">adegenet-forum-bounces@lists.r-forge.r-project.org</a> [<br>
>> <a href="mailto:adegenet-forum-bounces@lists.r-forge.r-project.org">adegenet-forum-bounces@lists.r-forge.r-project.org</a>] on behalf of Spencer<br>
>> Bruce [<a href="mailto:goatsrunfaster@gmail.com">goatsrunfaster@gmail.com</a>]<br>
>> *Sent:* 23 October 2014 15:29<br>
>> *To:* <a href="mailto:adegenet-forum@lists.r-forge.r-project.org">adegenet-forum@lists.r-forge.r-project.org</a><br>
>> *Subject:* [adegenet-forum] repooling random rows from genind objects<br>
>><br>
>>    Hello All!<br>
>><br>
>>  I have three seperate populations as genind objects. What I would like<br>
>> to do is pull a certain number of random individuals from each, to form a<br>
>> new single genind population.<br>
>><br>
>>  I would then like individuals from this new genind population to mate<br>
>> randomly, producing another genind object which would contain their<br>
>> offspring.<br>
>><br>
>>  Below is the code I came up with (which does not work):<br>
>><br>
>>  Year1 <- repool(F1[sample(nrow(F1), 500), ], pop1[sample(nrow(pop1),<br>
>> 750), ], pop2[sample(nrow(pop2), 750), ], n=2000)<br>
>><br>
>>  Year2 <- hybridize(Year1[sample(nrow(Year1), 1000), ],<br>
>> Year1[sample(nrow(Year1), 1000), ], n=2000)<br>
>><br>
>><br>
>>  any help would be greatly appreciated!<br>
>><br>
>>  Best,<br>
>> Spencer<br>
>><br>
>>  --<br>
>> Spencer A Bruce<br>
>> 200 Washington St.<br>
>> Troy, NY 12180<br>
>> 518 225 0787<br>
>><br>
><br>
><br>
><br>
>  --<br>
> Spencer A Bruce<br>
> 200 Washington St.<br>
> Troy, NY 12180<br>
> 518 225 0787<br>
><br>
<br>
<br>
<br>
--<br>
Spencer A Bruce<br>
200 Washington St.<br>
Troy, NY 12180<br>
518 225 0787<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <<a href="http://lists.r-forge.r-project.org/pipermail/adegenet-forum/attachments/20141023/c51ccf09/attachment.html" target="_blank">http://lists.r-forge.r-project.org/pipermail/adegenet-forum/attachments/20141023/c51ccf09/attachment.html</a>><br>
<br>
------------------------------<br>
<br>
_______________________________________________<br>
adegenet-forum mailing list<br>
<a href="mailto:adegenet-forum@lists.r-forge.r-project.org">adegenet-forum@lists.r-forge.r-project.org</a><br>
<a href="https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/adegenet-forum" target="_blank">https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/adegenet-forum</a><br>
<br>
End of adegenet-forum Digest, Vol 74, Issue 9<br>
*********************************************<br>
</blockquote></div><br></div>