search for: wickh

Displaying 20 results from an estimated 30 matches for "wickh".

Did you mean: wich
2018 May 03
0
length of `...`
On Thu, May 3, 2018 at 8:18 AM, Duncan Murdoch <murdoch.duncan at gmail.com> wrote: > On 03/05/2018 11:01 AM, William Dunlap via R-devel wrote: >> >> In R-3.5.0 you can use ...length(): >> > f <- function(..., n) ...length() >> > f(stop("one"), stop("two"), stop("three"), n=7) >> [1] 3 >> >> Prior to
2018 May 08
0
download.file does not process gz files correctly (truncates them?)
On Tue, May 8, 2018 at 8:15 AM, Hadley Wickham <h.wickham at gmail.com> wrote: > On Thu, May 3, 2018 at 11:34 PM, Tomas Kalibera > <tomas.kalibera at gmail.com> wrote: >> On 05/03/2018 11:14 PM, Henrik Bengtsson wrote: >>> >>> Also, as mentioned in my >>> https://stat.ethz.ch/pipermail/r-deve...
2018 Jun 08
0
Subsetting the "ROW"s of an object
...>> > 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)...
2018 Jun 08
0
Subsetting the "ROW"s of an object
On Fri, Jun 8, 2018 at 2:09 PM, Berry, Charles <ccberry at ucsd.edu> wrote: > > >> 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. > > su...
2018 Jul 07
2
Testing for vectors
Hi all, Is there are base function that I've missed that tests if an object is a vector in the dimensionality sense, rather than the data structure sense? i.e. something that checks is.null(dim(x)) ? is.vector() is trivially disqualified since it also checks for the presence of non-names attributes: x <- factor(c("a", "a", "b")) is.vector(x) #> [1] FALSE
2018 Aug 08
0
vctrs: a type system for the tidyverse
>> So we say that a >> factor `x` has finer resolution than factor `y` if the levels of `y` >> are contained in `x`. So to find the common type of two factors, we >> take the union of the levels of each factor, given a factor that has >> finer resolution than both. > > I'm not so sure. I think a more useful definition of resolution may be > that it is
2018 Aug 30
0
ROBUSTNESS: x || y and x && y to give warning/error if length(x) != 1 or length(y) != 1
On Thu, Aug 30, 2018 at 10:58 AM Martin Maechler <maechler at stat.math.ethz.ch> wrote: > > >>>>> Joris Meys > >>>>> on Thu, 30 Aug 2018 14:48:01 +0200 writes: > > > On Thu, Aug 30, 2018 at 2:09 PM D?nes T?th > > <toth.denes at kogentum.hu> wrote: > >> Note that `||` and `&&` have never been
2018 Aug 30
1
build package with unicode (farsi) strings
On Thu, Aug 30, 2018 at 2:11 AM Thierry Onkelinx <thierry.onkelinx at inbo.be> wrote: > > Dear Farid, > > Try using the ASCII notation. letters_fa <- c("\u0627", "\u0641"). The full > code table is available at https://www.utf8-chartable.de It's a little easier to do this with code: letters_fa <-
2018 Aug 08
0
vctrs: a type system for the tidyverse
> > I now have a better argument, I think: > > > If you squint your brain a little, I think you can see > > that each set of automatic coercions is about increasing > > resolution. Integers are low resolution versions of > > doubles, and dates are low resolution versions of > > date-times. Logicals are low resolution version of >
2018 Aug 08
0
vctrs: a type system for the tidyverse
>>> Method dispatch for `vec_c()` is quite simple because associativity and >>> commutativity mean that we can determine the output type only by >>> considering a pair of inputs at a time. To this end, vctrs provides >>> `vec_type2()` which takes two inputs and returns their common type >>> (represented as zero length vector): >>> >>>
2018 Jul 23
2
Is NULL a vector?
Hi all, Would you generally consider NULL to be a vector? Base R functions are a little inconsistent: ## In favour ``` r identical(as.vector(NULL), NULL) #> [1] TRUE identical(as(NULL, "vector"), NULL) #> [1] TRUE # supports key vector vector generics length(NULL) #> [1] 0 NULL[c(3, 4, 5)] #> NULL NULL[[1]] #> NULL ``` ## Against ``` r is.vector(NULL) #> [1]
2018 Aug 24
1
conflicted: an alternative conflict resolution strategy
On Fri, Aug 24, 2018 at 4:28 AM Joris Meys <jorismeys at gmail.com> wrote: > > Dear Hadley, > > There's been some mails from you lately about packages on R-devel. I would argue that the appropriate list for that is R-pkg-devel, as I've been told myself not too long ago. People might get confused and think this is about a change to R itself, which it obviously is not. The
2018 May 03
2
length of `...`
On Thu, May 3, 2018 at 9:50 AM, Duncan Murdoch <murdoch.duncan at gmail.com> wrote: > On 03/05/2018 11:18 AM, Duncan Murdoch wrote: >> >> On 03/05/2018 11:01 AM, William Dunlap via R-devel wrote: >>> >>> In R-3.5.0 you can use ...length(): >>> > f <- function(..., n) ...length() >>> > f(stop("one"),
2018 Aug 30
0
ROBUSTNESS: x || y and x && y to give warning/error if length(x) != 1 or length(y) != 1
I think this is an excellent idea as it eliminates a situation which is almost certainly user error. Making it an error would break a small amount of existing code (even if for the better), so perhaps it should start as a warning, but be optionally upgraded to an error. It would be nice to have a fixed date (R version) in the future when the default will change to error. In an ideal world, I
2018 Jul 07
2
Testing for vectors
On Sat, Jul 7, 2018 at 12:54 PM, Duncan Murdoch <murdoch.duncan at gmail.com> wrote: > On 07/07/2018 1:20 PM, Hadley Wickham wrote: >> >> Hi all, >> >> Is there are base function that I've missed that tests if an object is >> a vector in the dimensionality sense, rather than the data structure >> sense? i.e. something that checks is.null(dim(x)) ? >> >> is.vector() is...
2018 Jun 08
0
Subsetting the "ROW"s of an object
...ch:tm> <bch:tm> <bch:tm> #> 1 arr[i, TRUE, TRUE, TRUE] 41.8ms 43.6ms 46.5ms #> 2 arr[i, , , ] 41.7ms 43.1ms 46.3ms On Fri, Jun 8, 2018 at 12:31 PM, Berry, Charles <ccberry at ucsd.edu> wrote: > > >> 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: >>>> >>>> A...
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
2018 May 03
0
Converting a list to a data frame
On Wed, May 2, 2018 at 11:53 AM, Jeff Newmiller <jdnewmil at dcn.davis.ca.us> wrote: > Another approach: > > ######## > library(tidyr) > L <- list( A = data.frame( x=1:2, y=3:4 ) > , B = data.frame( x=5:6, y=7:8 ) > ) > D <- data.frame( Type = names( L ) > , stringsAsFactors = FALSE > ) > D$data <- L
2018 Aug 09
2
vctrs: a type system for the tidyverse
> > As Gabe mentioned (and you've explained about) the term "type" > > is really confusing here. As you know, the R internals are all > > about SEXPs, TYPEOF(), etc, and that's what the R level > > typeof(.) also returns. As you want to use something slightly > > different, it should be different naming, ideally something not > > existing yet
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 > >&g...