Re: [R] sapply returning list instead of matrix

2014-02-02 Thread chris warth
Can I follow-up with what I've learned about my own myopia regarding sapply()? First, I appreciate all the feedback. After thinking about it for a while I realized R designers have often chosen to accommodate interactive usage, and in that context, sapply() returning different types makes perfe

Re: [R] sapply returning list instead of matrix

2014-01-31 Thread chris warth
Bert Gunter > Genentech Nonclinical Biostatistics > (650) 467-7374 > > "Data is not information. Information is not knowledge. And knowledge > is certainly not wisdom." > H. Gilbert Welch > > > > > On Fri, Jan 31, 2014 at 1:36 PM, chris warth wrote: &g

[R] sapply returning list instead of matrix

2014-01-31 Thread chris warth
Can anyone suggest a rationale for why sapply() returns different types (list and matrix) in the two examples below? Is there any way to get sapply() or any other apply() function to return a matrix in both cases? simplify=TRUE doesn't change the outcome. I understand why it is happening, I just

[R] readLines() behavior is really strange

2014-01-24 Thread chris warth
This might also be titled, "How do I use R as a streaming process?" I would like to use R as a streaming processor, but it seems to have trouble capturing all the input. Can someone explain why this script skips the first few lines of input? Is this a bug in R or some interaction with line bufferi