Brian Diggs

Portland, Oregon

I am a biostatistician working in the Department of Surgery at Oregon Health and Science University in Portland, Oregon.

Jul
18
awarded Enlightened
Jul
18
awarded Nice Answer
Jul
16
answered ggplot bar chart with two dataframes
Jul
15
answered Disable plot display in R
Jul
11
awarded Good Answer
Jul
10
revised preserve old (pre 3.1.0) type.convert behavior
3.1.1 released
Jul
4
comment R outer product of factors - custom mapping - way too slow
Numeric indexing will be faster than character indexing, but I thought this was clearer as to intent (and didn't feel the need to squeeze even more efficiency out of it). For an even more efficient solution, recognizing the assumptions about the mapping of labels to indexes that needs to be made, using the numeric version would be preferred.
Jul
3
comment How to create a list with names but no entries in R/Splus?
I would probably use mylist <- list() because it more clearly shows you are initializing an empty list. I actually am somewhat surprised that it works with setting it to NULL. I assume that mylist gets promoted from a NULL to a list when you assign to it that way.
Jul
3
answered R outer product of factors - custom mapping - way too slow
Jul
3
comment R outer product of factors - custom mapping - way too slow
mapping isn't a two dimensional array (matrix) either. Take a look at it; it is one dimensional.
Jul
2
comment Decision Tree not classifying 3 categories variable
Or just so few that they are never the plurality choice in any leaf.
Jun
30
revised Weird output when writing to text file in R
code formatting some of the output
Jun
20
comment Lisp/Scheme-like calls in R
Two resources to look at that do related things: do.call and %>% from the magrittr package. The former is similar to your . function (but takes the subsequent arguments as a list, not a separate arguments). The latter does much with manipulation of calls to make complete function calls and may have some techniques for getting environments and efficiency right.
Jun
13
revised Why are these numbers not equal?
Additional links from discussion on meta about a canonical answer; formatting
Jun
13
revised Is there any authoritative documentation on R release nicknames?
Added 3.0.1-3.1.0
Jun
11
comment Canonical duplicate for "floating point is inaccurate"
I would advocate language specific questions and answers (or at least answers). In the R language, we already have stackoverflow.com/q/9508518/892313 which covers the theory briefly (and mostly by reference to other sources) and spends most of the answer discussing R specific workarounds for the cases where this often comes up. To date, 40 questions have been closed as a duplicate for this one. Perhaps as a domain specific language for statistics, this comes up more often in the R tag and this is how we have dealt with it.
Jun
11
comment Canonical duplicate for "floating point is inaccurate"
While a language agnostic canonical question and answer may be useful, it should not supplant established language specific ones such as stackoverflow.com/q/9508518/892313 for the [tag:r] language which contain language specific techniques for managing this.
Jun
5
comment Constructing a function manually in R
You may find the chapter at adv-r.had.co.nz/Functions.html useful.
May
30
revised How can I view the source code for a function?
Section on getting source code for compiled functions in base packages (since the existing description for packages does not work for base packages)
May
27
revised Reuse an object created in a function in R
Tidying; put in missing quote.
1 2 3 4 5