Re: [R] data.table/ifelse conditional new variable question

2014-08-16 Thread John McKown
On Sat, Aug 16, 2014 at 9:02 PM, Kate Ignatius wrote: > Actually - your code is not wrong... because this is a large file I > went through the file to see if there was anything wrong with it - > looks like there are two fathers or three mothers in some families. > Taking these duplicates out fixe

[R] Fwd: opinion - sharing problem data and other stuff.

2014-08-16 Thread John McKown
Thanks for your thoughts, Sarah and Jeff! I do appreciate the time and effort. I will refrain from posting a link to a GIST as the main part of my response. But I still like the idea, but I'm going to modify it a bit. For any replies that I make which are not 3 or 4 lines, I'm going to create a new

Re: [R] data.table/ifelse conditional new variable question

2014-08-16 Thread Kate Ignatius
Actually - your code is not wrong... because this is a large file I went through the file to see if there was anything wrong with it - looks like there are two fathers or three mothers in some families. Taking these duplicates out fixed the problem. Sorry about the confusion! And thanks so much f

Re: [R] data.table/ifelse conditional new variable question

2014-08-16 Thread Kate Ignatius
Yep - you're right - missing parents are indicated as zero in the M/PID field. The above code worked with a few errors: 1: In l$PID[l$Relationship == "sibling"] <- l$Sample.ID[father] : number of items to replace is not a multiple of replacement length 2: In l$PID[l$Relationship == "sibling"] <

Re: [R] data.table/ifelse conditional new variable question

2014-08-16 Thread Kate Ignatius
Actually - I didn't check this before, but these are not all nuclear families (as I assumed they were). That is, some don't have a father or don't have a mother Usually if this is the case PID or MID will become 0, respectively, for the child. How can the code be edit to account for this? On

Re: [R] data.table/ifelse conditional new variable question

2014-08-16 Thread Kate Ignatius
Thanks! I think I know what is being done here but not sure how to fix the following error: Error in l$PID[l$\Relationship == "sibling"] <- l$Sample.ID[father] : replacement has length zero On Sat, Aug 16, 2014 at 6:48 PM, Jorge I Velez wrote: > Dear Kate, > > Assuming you have nuclear fami

Re: [R] Generating a polygon around points

2014-08-16 Thread Rolf Turner
On 17/08/14 01:57, Greg Snow wrote: On Fri, Aug 15, 2014 at 4:06 PM, Rolf Turner wrote: OTOH R is still lacking a mind_read() function so it probably would NOT give you *exactly* what you want. We can try the (very pre-alpha) esp package: source('g:/R/esp/esp.R') esp() [1] "piccalilli cra

Re: [R] data.table/ifelse conditional new variable question

2014-08-16 Thread Jorge I Velez
Dear Kate, Assuming you have nuclear families, one option would be: x <- read.table(textConnection("Family.ID Sample.ID Relationship 14 62 sibling 14 94 father 14 63 sibling 14 59 mother 17 6004 father 17 6003 mother 17 6005 s

[R] data.table/ifelse conditional new variable question

2014-08-16 Thread Kate Ignatius
Hi, I have a data.table question (as well as if else statement query). I have a large list of families (file has 935 individuals that are sorted by famiy of varying sizes). At the moment the file has the columns: SampleID FamilyID Relationship To prevent from having to make a pedigree file by

Re: [R] unable to use functions require DLL from package

2014-08-16 Thread David Winsemius
On Aug 16, 2014, at 1:54 AM, Lotte de Vries wrote: snipped all of your and my earlier material because you have included everything needed for an answer in your current question.. > > > > Hi David, > > Let me try this again, apologies. > > I'm trying to run the package posum > (http://www.

Re: [R] Generating a polygon around points

2014-08-16 Thread Greg Snow
On Fri, Aug 15, 2014 at 4:06 PM, Rolf Turner wrote: > OTOH R is still lacking a mind_read() function so it probably > would NOT give you *exactly* what you want. We can try the (very pre-alpha) esp package: > source('g:/R/esp/esp.R') > esp() [1] "piccalilli crawlspace mole swarthy thunderhead f