search for: kogentum

Displaying 20 results from an estimated 41 matches for "kogentum".

2020 Nov 20
2
return (x+1) * 1000
...ld end up throwing syntax errors on: function() return function() return 2*x function() return (2*x) + 1 while still accepting: function() return() function() return(2*x) function() return((2*x) + 1) Just my two Friday cents /Henrik On Fri, Nov 20, 2020 at 3:37 PM D?nes T?th <toth.denes at kogentum.hu> wrote: > > Yes, the behaviour of return() is absolutely consistent. I am wondering > though how many experienced R developers would predict the correct > return value just by looking at those code snippets. > > On 11/21/20 12:33 AM, Gabriel Becker wrote: > > And the r...
2020 Nov 20
2
return (x+1) * 1000
...all of this is just return() performing correctly though. If there are already R CMD CHECK checks for this kind of thing (I wasnt sure but I'm hearing from others there may be/are) that may be (and/or may need to be) sufficient. ~G On Fri, Nov 20, 2020 at 3:27 PM D?nes T?th <toth.denes at 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/20 10:12 PM, Mateo Obreg?n wrote: > > Dear r-developers- > > > &gt...
2018 May 03
7
length of `...`
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 = undefined) How can I define a method for length() which could be called directly on `...`? Or is it an
2020 Nov 21
1
return (x+1) * 1000
...1 >> >> while still accepting: >> >> function() return() >> function() return(2*x) >> function() return((2*x) + 1) >> >> Just my two Friday cents >> >> /Henrik >> >> On Fri, Nov 20, 2020 at 3:37 PM D?nes T?th <toth.denes at kogentum.hu> wrote: >>> >>> Yes, the behaviour of return() is absolutely consistent. I am wondering >>> though how many experienced R developers would predict the correct >>> return value just by looking at those code snippets. >>> >>> On 11/21/20 12:...
2017 Sep 28
0
Searching for Enumerated Items using str_count() from the stringr package
...r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. > -- Dr. T?th D?nes ?gyvezet? Kogentum Kft. Tel.: 06-30-2583723 Web: www.kogentum.hu
2017 Sep 28
2
Searching for Enumerated Items using str_count() from the stringr package
Hi all, I have a large number of text strings to search for enumerated items. However, I am receiving this error message even though I thought that I properly escaped the special character closed parenthesis: > Count<-str_count(text3,keywords) Error in stri_count_regex(string, pattern, opts_regex = opts(pattern)) : Syntax error in regexp pattern. (U_REGEX_RULE_SYNTAX) === Here is
2020 Nov 21
0
return (x+1) * 1000
...tion() return 2*x > function() return (2*x) + 1 > > while still accepting: > > function() return() > function() return(2*x) > function() return((2*x) + 1) > > Just my two Friday cents > > /Henrik > > On Fri, Nov 20, 2020 at 3:37 PM D?nes T?th <toth.denes at kogentum.hu> wrote: > > > > Yes, the behaviour of return() is absolutely consistent. I am wondering > > though how many experienced R developers would predict the correct > > return value just by looking at those code snippets. > > > > On 11/21/20 12:33 AM, Gabriel Bec...
2020 Mar 12
2
support of `substitute(...())`
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 - the most frequent solution there is `substitute(list(...))[-1L] ` I would like to know if: 1)
2020 Nov 20
0
return (x+1) * 1000
...ng correctly > though. If there are already R CMD CHECK checks for this kind of thing > (I wasnt?sure but I'm hearing from others there may be/are) that may be > (and/or may need to be) sufficient. > > ~G > > On Fri, Nov 20, 2020 at 3:27 PM D?nes T?th <toth.denes at kogentum.hu > <mailto:toth.denes at 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/2...
2018 Aug 30
3
ROBUSTNESS: x || y and x && y to give warning/error if length(x) != 1 or length(y) != 1
>>>>> 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 symmetric: >> >> TRUE || stop() # returns TRUE stop() || TRUE # returns an >> error >> >> > Fair point. So the suggestion would be to check whether x > is of...
2018 Aug 30
3
ROBUSTNESS: x || y and x && y to give warning/error if length(x) != 1 or length(y) != 1
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, FALSE) || TRUE > > would mean
2018 May 03
1
Converting a list to a data frame
...ared for those differences. (To learn more, read the data tables vignette.) Tibbles (as produced by unnest in my previous response) are not data tables either, but they behave much more like data frames than data tables do. On May 2, 2018 1:30:37 PM MDT, "T?th D?nes" <toth.denes at kogentum.hu> wrote: > > >On 05/02/2018 07:11 PM, Kevin E. Thorpe wrote: >> I suspect this is pretty easy, but I'm having trouble figuring it >out. >> Basically, I have a list of data frames such as the following >example: >> >> list(A=data.frame(x=1:2, y=3:4),...
2020 May 01
1
Request: tools::md5sum should accept connections and finally in-memory objects
...kage 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 <toth.denes at kogentum.hu >> <mailto:toth.denes at kogentum.hu>> 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::md5sum() which calc...
2020 Oct 19
1
Is there any way to check the class of an ALTREP?
...ject? */` > > This is also what the ALTREP macro checks. However, I also did not > notice the "... if an ALTREP object is from my package" part. I am > sorry. > > Sincerely Yours, > Benjamin > > Den man. 19. okt. 2020 kl. 11.25 skrev D?nes T?th <toth.denes at kogentum.hu > >: > > > > 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. &...
2020 Oct 19
2
Is there any way to check the class of an ALTREP?
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 if you can you use the ALTREP macro as done in this > package:
2018 Aug 31
1
ROBUSTNESS: x || y and x && y to give warning/error if length(x) != 1 or length(y) != 1
...M 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 symmetric: > >> > >> TRUE || stop() # returns TRUE stop() || TRUE # returns an > >> error > >> > >> > > Fair point....
2020 Oct 06
0
understanding as.list(substitute(...()))
Hi Tim, I have also asked a similar question a couple of months ago, and someone else did the same recently, maybe on r-devel. We received no "official" response, but Deepayan Sarkar (R Core Team member) claimed that: " There is no documented reason for this to work (AFAIK), so again, I would guess this is a side-effect of the implementation, and not a API feature you should
2018 Apr 27
0
Package 'data.table' in version R-3.5.0 not successfully being installed
...it would be better to fix data.table in the sources. From the looks of it, I wouldn't be surprised if the root cause is the changes to POSIXlt methods in 3.5.0, but I haven't actually been digging in to check that. - Peter D. > On 26 Apr 2018, at 23:32 , D?nes T?th <toth.denes at kogentum.hu> wrote: > > You might find this discussion useful, too: > https://github.com/Rdatatable/data.table/issues/2797 > > > On 04/26/2018 11:01 PM, Henrik Bengtsson wrote: >> If you're installing packages to the default location in your home >> account and you di...
2020 May 01
4
Request: tools::md5sum should accept connections and finally in-memory objects
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 areas, as demonstrated by the popularity of the 'digest' package (~850.000 downloads/month). Upon
2020 Oct 06
3
understanding as.list(substitute(...()))
I probably need to be more specific. What confuses me is not the use of substitute, but the parenthesis after the dots. It clearly works and I can make guesses as to why but it is definitely not obvious. The following function gives the same final result but I can understand what is happening. dots <- function (...) { exprs <- substitute(list(...)) as.list(exprs[-1]) } In the