[Bioc-devel] BSgenome changes

2020-08-12 Thread Leonard Goldstein via Bioc-devel
Dear Bioc team, I'm following up on this recent GitHub issue . Please see the issue for more details and code examples. It looks like changes in Bioc devel result in two copies of the mitochondrial chromosome for BSgenome.Hsapiens.UCSC.hg19 -- one named

Re: [Bioc-devel] sapply and vapply

2020-08-12 Thread Laurent Gatto
Thank you for these instructive, although somewhat disheartening clarifications. Laurent From: Henrik Bengtsson Sent: 12 August 2020 19:01 To: Laurent Gatto Cc: bioc-devel@r-project.org Subject: Re: [Bioc-devel] sapply and vapply FWIW, > sapply(X,

Re: [Bioc-devel] sapply and vapply

2020-08-12 Thread Martin Morgan
Check the result of sapply(logical(0), all) ! On 8/12/20, 12:33 PM, "Bioc-devel on behalf of Laurent Gatto" wrote: Dear all, I have a quick question regarding the usage of vapply and sapply. The former is recommended to insure that the output is always a vector of a specific

Re: [Bioc-devel] sapply and vapply

2020-08-12 Thread Henrik Bengtsson
FWIW, > sapply(X, length) - always numeric(1) (integer(1) or double(1) for vectors of > more than 2^31 - 1 elements) Actually, the length of length(x) may not be 1L, e.g. > x <- Formula::Formula(~ x) > length(x) [1] 0 1 >From help("length", package = "base"): "Warning: Package authors have

[Bioc-devel] sapply and vapply

2020-08-12 Thread Laurent Gatto
Dear all, I have a quick question regarding the usage of vapply and sapply. The former is recommended to insure that the output is always a vector of a specific type. For example: > df1 <- data.frame(x = 1:3, y = LETTERS[1:3]) ## OK test > df2 <- data.frame(x = 1:3, y = Sys.time() + 1:3)