search for: wickham

Displaying 20 results from an estimated 919 matches for "wickham".

2007 Feb 25
8
Double-banger function names: preferences and suggestions
What do you prefer/recommend for double-banger function names: 1 scale.colour 2 scale_colour 3 scaleColour 1 is more R-like, but conflicts with S3. 2 is a modern version of number 1, but not many packages use it. Number 3 is more java-like. (I like number 2 best) Any suggestions? Thanks, Hadley
2018 Jun 08
3
Subsetting the "ROW"s of an object
> On Jun 8, 2018, at 1:49 PM, Hadley Wickham <h.wickham at gmail.com> wrote: > > Hmmm, yes, there must be some special case in the C code to avoid > recycling a length-1 logical vector: Here is a version that (I think) handles Herve's issue of arrays having one or more 0 dimensions. subset_ROW <- function(x,i) {...
2010 Aug 24
2
Comparing/diffing strings
Hi all, all.equal is generally very useful when you want to find the differences between two objects. It breaks down however, when you have two long strings to compare: > all.equal(a, b) [1] "1 string mismatch" Does any one know of any good text diffing tools implemented in R? Thanks, Hadley -- Assistant Professor / Dobelman Family Junior Chair Department of Statistics / Rice
2018 Jun 08
4
Subsetting the "ROW"s of an object
> On Jun 8, 2018, at 11:52 AM, Hadley Wickham <h.wickham at gmail.com> wrote: > > On Fri, Jun 8, 2018 at 11:38 AM, Berry, Charles <ccberry at ucsd.edu> wrote: >> >> >>> On Jun 8, 2018, at 10:37 AM, Herv? Pag?s <hpages at fredhutch.org> wrote: >>> >>> Also the TRUEs cause proble...
2018 Jun 08
6
Subsetting the "ROW"s of an object
Hi all, Is there a better to way to subset the ROWs (in the sense of NROW) of an vector, matrix, data frame or array than this? subset_ROW <- function(x, i) { nd <- length(dim(x)) if (nd <= 1L) { x[i] } else { dims <- rep(list(quote(expr = )), nd - 1L) do.call(`[`, c(list(quote(x), quote(i)), dims, list(drop = FALSE))) } } subset_ROW(1:10, 4:6) #> [1] 4 5 6
2018 Aug 25
4
Where does L come from?
Hi all, Would someone mind pointing to me to the inspiration for the use of the L suffix to mean "integer"? This is obviously hard to google for, and the R language definition (https://cran.r-project.org/doc/manuals/r-release/R-lang.html#Constants) is silent. Hadley -- http://hadley.nz
2016 Aug 05
1
What happened to Ross Ihaka's proposal for a Common Lisp based R successor?
But you can easily fall back to R from within Julia; see http://juliastats.github.io/RCall.jl/latest/ On Aug 5, 2016 1:27 PM, "Hadley Wickham" <h.wickham at gmail.com> wrote: > No. > > Hadley > > On Fri, Aug 5, 2016 at 11:12 AM, Kenny Bell <kmbell56 at gmail.com> wrote: > > Is it conceivable that Julia could be ported to use R syntax in a way > that > > would allow the vastly larger numbers...
2015 Oct 13
1
A where() functions that does what exists() does but return the environment when object lives?
On Tue, Oct 13, 2015 at 4:43 PM, Hadley Wickham <h.wickham at gmail.com> wrote: > Seems easy enough to write yourself: > > where <- function(x, env = parent.frame()) { > if (identical(env, emptyenv())) > return(NULL) > if (exists(x, envir = env, inherits = FALSE)) > return(env) > where...
2009 Aug 28
0
SFBA R Users Group - Fall kickoff w/ Hadley Wickham, more news, & call for presenters
The San Francisco Bay Area useR Group is very excited to host Hadley Wickham on Sep 17 for our Fall kickoff meeting. Details at http://www.meetup.com/R-Users/calendar/10446894/ This year we are moving our regular meeting monthly meeting to the 2nd Tuesday of each month. Also, we hope to rotate the venue around the Bay Area. Hadley's presentation will be on the Cal Berk...
2016 Aug 05
2
What happened to Ross Ihaka's proposal for a Common Lisp based R successor?
Is it conceivable that Julia could be ported to use R syntax in a way that would allow the vastly larger numbers of R programmers to seamlessly switch? Or equivalently, could an iteration of R itself do this? On Fri, Aug 5, 2016, 9:00 AM Hadley Wickham <h.wickham at gmail.com> wrote: > When it was being actively worked on, it had the advantage of existing. > > Hadley > > On Fri, Aug 5, 2016 at 10:48 AM, Kenny Bell <kmbell56 at gmail.com> wrote: > > Why is the described system preferable to Julia? > > > &...
2018 Jun 08
2
Subsetting the "ROW"s of an object
I suspect this will have suboptimal performance since the TRUEs will get recycled. (Maybe there is, or could be, ALTREP, support for recycling) Hadley On Fri, Jun 8, 2018 at 10:16 AM, Berry, Charles <ccberry at ucsd.edu> wrote: > > >> On Jun 8, 2018, at 8:45 AM, Hadley Wickham <h.wickham at gmail.com> wrote: >> >> Hi all, >> >> Is there a better to way to subset the ROWs (in the sense of NROW) of >> an vector, matrix, data frame or array than this? > > > You can use TRUE to fill the subscripts for dimensions 2:nd > >>...
2004 Oct 07
5
Subset doesn't drop unused factor levels
a <- data.frame(b = rep(1:5, each=2), c=factor(rep("a",10), levels=c("a","b"))) levels(subset(a, b=1, drop=T)$c) # [1] "a" "b" Is this a bug? Thanks,, Hadley
2015 Mar 30
3
Segfault with match()
This is admittedly a contrived example, but... data(housing, package ="MASS") x <- housing$Type + housing$Sat match(x, unique(x)) Hadley -- http://had.co.nz/
2006 Mar 07
3
Making an S3 object act like a data.frame
"[.ggobiDataset" <- function(x, ..., drop=FALSE) { x <- as.data.frame(x) NextMethod("[", x) } "[[.ggobiDataset" <- function(x, ..., drop=FALSE) { x <- as.data.frame(x) NextMethod("[[", x) } "$.ggobiDataset" <- function(x, ..., drop=FALSE) { x <- as.data.frame(x) NextMethod("$", x) } > class(x) [1]
2007 May 30
1
Static and dynamic graphics course, July 2007, Salt Lake City
We're pleased to announce a one day course covering static and dynamic graphics using R, ggplot and GGobi. The course will be held just before the JSM, on Saturday, 28 July 2007, in Salt Lake City. The course will be presented by Dianne Cook and Hadley Wickham. In the course you will learn: * How to build presentation quality static graphics using the R package, ggplot. We will cover plot creation and modification, and discuss the grammar which underlies the package. * How to explore your data with direct manipulation/dynamic graphics using GGobi and...
2015 Aug 13
3
Bug in rank with utf8?
x <- "\u0663" y <- 3 x == y # FALSE rank(c(x, y)) # c(1.5, 1.5) -- http://had.co.nz/
2019 May 16
3
nrow(rbind(character(), character())) returns 2 (as documented but very unintuitive, IMHO)
Hi Hadley, Thanks for the counterpoint. Response below. On Thu, May 16, 2019 at 1:59 PM Hadley Wickham <h.wickham at gmail.com> wrote: > The existing behaviour seems inutitive to me. I would consider these > invariants for n vector x_i's each with size m: > > * nrow(rbind(x_1, x_2, ..., x_n)) equals n > Personally, no I wouldn't. I would consider m==0 a degenerate case...
2011 Oct 18
9
readRDS and saveRDS
Hi all, Is there any chance that readRDS and saveRDS might one day become read.rds and write.rds? That would make them more consistent with the other reading and writing functions. Hadley -- Assistant Professor / Dobelman Family Junior Chair Department of Statistics / Rice University http://had.co.nz/
2015 Mar 30
1
Segfault with match()
...methods ("Ops.factor", "Ops.ordered") for "+" >> str(x) # 2 levels, so integer codes of 3 is illegal > ordered[1:2] w/ 2 levels B<C: 2 3 > > > Bill Dunlap > TIBCO Software > wdunlap tibco.com > > On Mon, Mar 30, 2015 at 1:10 PM, Hadley Wickham <h.wickham at gmail.com> wrote: >> >> This is admittedly a contrived example, but... >> >> data(housing, package ="MASS") >> x <- housing$Type + housing$Sat >> match(x, unique(x)) >> >> Hadley >> >> -- >> http://ha...
2018 Jun 08
3
Subsetting the "ROW"s of an object
...blems if some dimensions are 0: > > > matrix(raw(0), nrow=5, ncol=0)[1:3 , TRUE] > Error in matrix(raw(0), nrow = 5, ncol = 0)[1:3, TRUE] : > (subscript) logical subscript too long OK. But this is easy enough to handle. > > H. > > On 06/08/2018 10:29 AM, Hadley Wickham wrote: >> I suspect this will have suboptimal performance since the TRUEs will >> get recycled. (Maybe there is, or could be, ALTREP, support for >> recycling) >> Hadley AFAICS, it is not an issue. Taking arr <- array(rnorm(2^22),c(2^10,4,4,4)) as a test case and us...