Re: [R-pkg-devel] Package required but not available: ‘arrow’

2024-02-22 Thread Dénes Tóth
Depending on your use case you can also take a look at the nanoarrow package (https://cran.r-project.org/package=nanoarrow). Maybe it provides all the features you need and has a much smaller footprint than 'arrow'. Best, Denes On 2/22/24 10:01, Duncan Murdoch wrote: If you look on the CRAN

Re: [Rd] removeSource() vs. function literals

2023-03-31 Thread Dénes Tóth
On 3/31/23 08:49, Lionel Henry via R-devel wrote: If you can afford a dependency on rlang, `rlang::zap_srcref()` deals with this. It's recursive over expression vectors, calls (including calls to `function` and their hidden srcref arg), and function objects. It's implemented in C for

Re: [Rd] R check false positive - multiple versions of a dependency

2021-04-25 Thread Dénes Tóth
on my own if there is any chance that my patch will be accepted. Regards, Denes Duncan Murdoch On 21/04/2021 6:57 a.m., Dénes Tóth wrote: Disclaimer: I sent this report first to r-package-de...@r-project.org but it seems it has not been delivered to the list - re-trying to r-devel Dear R m

[Rd] R check false positive - multiple versions of a dependency

2021-04-24 Thread Dénes Tóth
Disclaimer: I sent this report first to r-package-de...@r-project.org but it seems it has not been delivered to the list - re-trying to r-devel Dear R maintainers, Use case: Restrict the acceptable versions of an imported package (e.g., 'pkg') to a closed interval. That is,

Re: [Rd] New pipe operator

2020-12-07 Thread Dénes Tóth
On 12/7/20 11:09 PM, Gabriel Becker wrote: On Mon, Dec 7, 2020 at 11:05 AM Kevin Ushey wrote: IMHO the use of anonymous functions is a very clean solution to the placeholder problem, and the shorthand lambda syntax makes it much more ergonomic to use. Pipe implementations that crawl the

Re: [Rd] [External] Re: New pipe operator

2020-12-06 Thread Dénes Tóth
Hi Gabriel, Thanks for the comments. See inline. On 12/6/20 8:16 PM, Gabriel Becker wrote: Hi Denes, On Sun, Dec 6, 2020 at 6:43 AM Dénes Tóth <mailto:toth.de...@kogentum.hu>> wrote: Dear Luke, In the meantime I checked the R-syntax branch and the docs; they are very h

Re: [Rd] [External] Re: New pipe operator

2020-12-06 Thread Dénes Tóth
On 12/6/20 4:32 PM, Duncan Murdoch wrote: > On 06/12/2020 9:43 a.m., Dénes Tóth wrote: >> Dear Luke, >> >> In the meantime I checked the R-syntax branch and the docs; they are >> very helpful. I would also like to thank you for putting effort into >> this

Re: [Rd] [External] Re: New pipe operator

2020-12-06 Thread Dénes Tóth
Dear Luke, In the meantime I checked the R-syntax branch and the docs; they are very helpful. I would also like to thank you for putting effort into this feature. Keeping it at the syntax level is also a very smart decision. However, the current API might not exploit the full power of the

Re: [Rd] New pipe operator

2020-12-04 Thread Dénes Tóth
On 12/4/20 3:05 PM, Duncan Murdoch wrote: ... It's tempting to suggest it should allow something like   mtcars |> subset(cyl == 4) |> lm(mpg ~ disp, data = .) which would be expanded to something equivalent to the other versions: but that makes it quite a bit more complicated.  (Maybe _

Re: [Rd] return (x+1) * 1000

2020-11-20 Thread Dénes Tóth
ient. ~G On Fri, Nov 20, 2020 at 3:27 PM Dénes Tóth <mailto:toth.de...@kogentum.hu>> wrote: Or even more illustratively: uneval_after_return <- function(x) {    return(x) * stop("Not evaluated") } uneval_after_return(1) # [1] 1 On 11/20

Re: [Rd] return (x+1) * 1000

2020-11-20 Thread Dénes Tóth
Or even more illustratively: uneval_after_return <- function(x) { return(x) * stop("Not evaluated") } uneval_after_return(1) # [1] 1 On 11/20/20 10:12 PM, Mateo Obregón wrote: Dear r-developers- After many years of using and coding in R and other languages, I came across something that I

Re: [Rd] Is there any way to check the class of an ALTREP?

2020-10-19 Thread Dénes Tóth
Benjamin, You happened to send a link which points to the OP's own package :) I think Jiefei would like to know how one can "officially" determine if an arbitrary ALTERP object belongs to a class that he owns. Regards, Denes On 10/19/20 10:22 AM, Benjamin Christoffersen wrote: It seems as

Re: [Rd] Request: tools::md5sum should accept connections and finally in-memory objects

2020-05-01 Thread Dénes Tóth
was meant for keeping potential further enhancements in mind. Duncan Murdoch On 01/05/2020 5:00 p.m., Dénes Tóth wrote: AFAIK there is no hashing utility in base R which can create hash digests of arbitrary R objects. However, as also described by Henrik Bengtsson in [1], we have tools

Re: [Rd] Request: tools::md5sum should accept connections and finally in-memory objects

2020-05-01 Thread Dénes Tóth
st package provides, one should install and load it. But if one can live with MD5 hashes, why not use the built-in R function? (Well, without serializing an object to a file, calling tools::md5sum, and then cleaning up the file.) On May 1, 2020, at 2:00 PM, Dénes Tóth <mailto:toth.de...@kogent

[Rd] Request: tools::md5sum should accept connections and finally in-memory objects

2020-05-01 Thread Dénes Tóth
AFAIK there is no hashing utility in base R which can create hash digests of arbitrary R objects. However, as also described by Henrik Bengtsson in [1], we have tools::md5sum() which calculates MD5 hashes of files. Calculating hashes of in-memory objects is a very common task in several

Re: [Rd] support of `substitute(...())`

2020-03-12 Thread Dénes Tóth
eature of the language. Bill Dunlap TIBCO Software wdunlap tibco.com <http://tibco.com> On Thu, Mar 12, 2020 at 2:09 AM Dénes Tóth <mailto:toth.de...@kogentum.hu>> wrote: Dear R Core Team, I learnt approx. two years ago in this mailing list that one can use the fol

[Rd] support of `substitute(...())`

2020-03-12 Thread Dénes Tóth
Dear R Core Team, I learnt approx. two years ago in this mailing list that one can use the following "trick" to get a (dotted pair)list of the ellipsis arguments inside a function: `substitute(...())` Now my problem is that I can not find any occurrence of this call within the R source -

Re: [Rd] Patch idea: an environment variable for setting the user ID

2019-11-22 Thread Dénes Tóth
Maybe a further thing to consider is to introduce an environment variable by which one can avoid `add_build_stamp_to_description_file()` and any other calls altogether which affect bitwise reproducibility during the build process. If two users build the same package on exactly the same

Re: [Rd] class() |--> c("matrix", "arrary") [was "head.matrix ..."]

2019-11-15 Thread Dénes Tóth
Hi Abby, On 11/15/19 10:19 PM, Abby Spurdle wrote: And indeed I think you are right on spot and this would mean that indeed the implicit class "matrix" should rather become c("matrix", "array"). I've made up my mind (and not been contradicted by my fellow R corers) to try go there for R

Re: [Rd] True length - length(unclass(x)) - without having to call unclass()?

2018-09-03 Thread Dénes Tóth
ration purposes. I totally agree that is should not be used for the purpose you described and I have never ever done so. Regards, Denes Tomas On 09/02/2018 01:19 AM, Dénes Tóth wrote: The solution below introduces a dependency on data.table, but otherwise it does what you need: --- # spec

Re: [Rd] True length - length(unclass(x)) - without having to call unclass()?

2018-09-01 Thread Dénes Tóth
The solution below introduces a dependency on data.table, but otherwise it does what you need: --- # special method for Foo objects length.Foo <- function(x) { length(unlist(x, recursive = TRUE, use.names = FALSE)) } # an instance of a Foo object x <- structure(list(a = 1, b = list(b1 = 1,

Re: [Rd] ROBUSTNESS: x || y and x && y to give warning/error if length(x) != 1 or length(y) != 1

2018-08-30 Thread Dénes Tóth
On 08/30/2018 01:56 PM, Joris Meys wrote: I have to agree with Emil here. && and || are short circuited like in C and C++. That means that TRUE || c(TRUE, FALSE) FALSE && c(TRUE, FALSE) cannot give an error because the second part is never evaluated. Throwing a warning or error for c(TRUE,

Re: [Rd] ROBUSTNESS: x || y and x && y to give warning/error if length(x) != 1 or length(y) != 1

2018-08-30 Thread Dénes Tóth
Hi, I absolutely second Henrik's suggestion. On 08/30/2018 01:09 PM, Emil Bode wrote: I have to disagree, I think one of the advantages of '||' (or &&) is the lazy evaluation, i.e. you can use the first condition to "not care" about the second (and stop errors from being thrown). I do not

[Rd] length of `...`

2018-05-03 Thread Dénes Tóth
Hi, In some cases the number of arguments passed as ... must be determined inside a function, without evaluating the arguments themselves. I use the following construct: dotlength <- function(...) length(substitute(expression(...))) - 1L # Usage (returns 3): dotlength(1, 4, something =

[Rd] possible bug in utils::removeSource - NULL argument is silently dropped

2017-12-11 Thread Dénes Tóth
Dear R-Core Team, I found an unexpected behaviour in utils::removeSource (also present in r-devel as of today). --- # create a function which accepts NULL argument foo <- function(x, y) { if (is.null(y)) y <- "default foo" attr(x, "foo") <- y x } # create a function which utilizes

Re: [Rd] R-devel does not update the C++ returned variables

2015-03-02 Thread Dénes Tóth
On 03/02/2015 04:37 PM, Martin Maechler wrote: On 2 March 2015 at 09:09, Duncan Murdoch wrote: | I generally recommend that people use Rcpp, which hides a lot of the | details. It will generate your .Call calls for you, and generate the | C++ code that receives them; you just need to think

Re: [Rd] Request to speed up save()

2015-01-15 Thread Dénes Tóth
On 01/15/2015 01:45 PM, Stewart Morris wrote: Hi, I am dealing with very large datasets and it takes a long time to save a workspace image. The options to save compressed data are: gzip, bzip2 or xz, the default being gzip. I wonder if it's possible to include the pbzip2

Re: [Rd] memory allocation if multiple names point to the same object

2014-06-03 Thread Dénes Tóth
, 2014 at 9:31 AM, Dénes Tóth toth.de...@ttk.mta.hu mailto:toth.de...@ttk.mta.hu wrote: Hi, Please consider the following code: a - seq.int http://seq.int(10) # create a tracemem(a) a[1:4] - 4:1 # no internal copy b - a # no internal copy b[1:4] - 1:4 # copy

[Rd] memory allocation if multiple names point to the same object

2014-06-02 Thread Dénes Tóth
Hi, Please consider the following code: a - seq.int(10) # create a tracemem(a) a[1:4] - 4:1 # no internal copy b - a # no internal copy b[1:4] - 1:4 # copy, b is not a any more a[1:4] - 1:4 # copy, but why? With results: a - seq.int(10) tracemem(a) [1] 0x1792bc0 a[1:4] -