similar to: formula argument evaluation

Displaying 20 results from an estimated 5000 matches similar to: "formula argument evaluation"

2016 Apr 12
2
formula argument evaluation
On Tue, Apr 12, 2016 at 2:08 PM, Duncan Murdoch <murdoch.duncan at gmail.com> wrote: > [...] > > It never gets to evaluating it. It is not a legal R statement, so the parser signals an error. > If you want to pass arbitrary strings to a function, you need to put them in quotes. I see. I thought it was parsed inside the function, but if it's parsed before then quoting is the
2016 Apr 13
2
formula argument evaluation
I suppose it would work, although "=>" is rather a descriptive symbol and less a function. But choosing between quoting: "A + B => C" and a regular function: A + B %=>% C probably quoting is the most straightforward, as the result of the foo() function has to be a string anyways (which is parsed by other functions). On Tue, Apr 12, 2016 at 6:20 PM, Richard M.
2016 Apr 12
0
formula argument evaluation
On 12/04/2016 6:24 AM, Adrian Du?a wrote: > I have a simple function such as: > > foo <- function(x) { > call <- lapply(match.call(), deparse) > testit <- capture.output(tryCatch(eval(x), error = function(e) e)) > if (grepl("Error", testit)) { > return(call$x) > } > } > > and I would like to detect a formula when x is
2016 Apr 12
0
formula argument evaluation
Would making it regular function %=>%, using "%" instead of quotes, work for you? On Tue, Apr 12, 2016 at 11:09 AM, Adrian Du?a <dusa.adrian at unibuc.ro> wrote: > On Tue, Apr 12, 2016 at 2:08 PM, Duncan Murdoch <murdoch.duncan at gmail.com> > wrote: >> [...] >> >> It never gets to evaluating it. It is not a legal R statement, so the > parser
2016 Apr 13
0
formula argument evaluation
%=>% would have precendence ('order of operations') problems also. A + B %=>% C is equivalent to A + ( B %=>% C) and I don't think that is what you want. as.list(quote(A + B %=>% C)) shows the first branch in the parse tree. The following function, str.language, shows the entire parse tree, as in > str.language(quote(A + B %=>% C)) `quote(A + B %=>%
2020 Apr 13
3
detect ->
Using => and <= instead of -> and <- would make things easier, although the precedence would be different. Bill Dunlap TIBCO Software wdunlap tibco.com On Mon, Apr 13, 2020 at 1:43 AM Adrian Du?a <dusa.adrian at gmail.com> wrote: > Thank you for your replies, this actually has little to do with the > regular R code but more to signal what in my package QCA is referred
2020 Apr 13
3
detect ->
Adrian, Indeed, this has come up in a few places, but as Gabor says, there is no such thing as right hand assignment at any point after parsing is complete. This means the only feasible way to detect it, which a few projects do I believe, is process the code while it is still raw text, before it goes into the parser, and have clever enough regular expressions. The next question, then, is why
2020 Apr 13
2
detect ->
I searched and tried for hours, to no avail although it looks simple. (function(x) substitute(x))(A <- B) #A <- B (function(x) substitute(x))(A -> B) # B <- A In the first example, A occurs on the LHS, but in the second example A is somehow evaluated as if it occured on the RHS, despite my understanding that substitute() returns the unevaluated parse tree. Is there any way, or is
2020 May 22
2
GCC warning
I am trying to submit a package on CRAN, and everything passes ok on all platforms but Debian, where CRAN responds with an automatic "significant" warning: * checking whether package ?QCA? can be installed ... [35s/35s] WARNING Found the following significant warnings: /usr/include/x86_64-linux-gnu/bits/string_fortified.h:106:10: warning: ?__builtin_strncpy? output may be truncated
2015 Oct 06
4
authorship and citation
Adrian, I am not on the CRAN or R-core teams, so the following is my own view, but... > library(QCA) > > Users are encouraged to cite this package as: > > Dusa, Adrian (2015). QCA: Qualitative Comparative Analysis. R Package > Version 1.2-0, > URL: http://cran.r-project.org/package=QCA > > This is just an encouragement, not a requirement, and the official citation
2018 Mar 09
2
importing namespaces from base packages
Dear All, I understand the R CMD checks with only the base package attached, everything else (including the other packages bundled with the base R) should be imported and most importantly declared in the Imports field from the DESCRIPTION file. However, I do use functions from other packages than base (utils, grDevices, stats, graphics), for which it is sufficient to declare importFrom() in the
2017 Jun 27
2
paste strings in C
Dear R-devs, Below is a small example of what I am trying to achieve, that is trivial in R and I would like to learn how to do in C, for very large matrices: > (mymat <- matrix(c(1,0,0,2,2,1), nrow = 2)) [,1] [,2] [,3] [1,] 1 0 2 [2,] 0 2 1 And I would like to produce: [1] "a*C" "B*c" Which can be trivially done in R via something like: foo
2015 Oct 06
2
authorship and citation
Adrian, Responses inline On Tue, Oct 6, 2015 at 1:58 PM, Adrian Du?a <dusa.adrian at unibuc.ro> wrote: > Hi Gabriel, > > On Tue, Oct 6, 2015 at 10:59 PM, Gabriel Becker <gmbecker at ucdavis.edu> > wrote: > >> [...] >> >> At the very least, this is seems to be a flagrant violation of the >> *spirit* of the CRAN policy, which AFAIK is intended to
2016 Apr 05
3
Problem with <= (less than or equal): not giving the expected result
Thanks Adrian and Thierry (from the previous answer). I was aware of the all.equal function, but there is nothing similar for <= (e.g. all.smallerEqual)? cheers, jo On 05 Apr 2016, at 14:31, Adrian Du?a <dusa.adrian at unibuc.ro<mailto:dusa.adrian at unibuc.ro>> wrote: Yes, that does have to do with floating point representation. I use this function for these types of
2015 Dec 17
1
integer
In the help page for ?is.integer, there is this function is.wholenumber <- function(x, tol = .Machine$double.eps^0.5) abs(x - round(x)) < tol A quick question: is there a case where this alternative function will not work? function(x) x %% 1 == 0 Best, Adrian -- Adrian Dusa University of Bucharest Romanian Social Data Archive Soseaua Panduri nr.90 050663 Bucharest sector 5
2020 Apr 15
1
detect ->
You are right. >= is not as evocative as =>. Perhaps > and < would do? %=>% and %<=% would work. Bill Dunlap TIBCO Software wdunlap tibco.com On Wed, Apr 15, 2020 at 12:41 AM Adrian Du?a <dusa.adrian at gmail.com> wrote: > Dear Bill, > > I already tried this, and it would have been great as (currently) the > sufficiency relation is precisely
2015 Oct 06
3
authorship and citation
On Oct 5, 2015, at 6:31 PM, Uwe Ligges <ligges at statistik.tu-dortmund.de> wrote: > > > On 05.10.2015 23:47, Andrew Robinson wrote: >> As a fourth option, I wonder if the first author could fork the package? >> >> Presumably, appropriately cited, a fork is permitted by the license under >> which it was released. Then the original package, by both
2018 Mar 13
2
importing namespaces from base packages
On Mon, Mar 12, 2018 at 2:18 PM, Martin Maechler <maechler at stat.math.ethz.ch> wrote: > [...] > Is that so? Not according to my reading of the 'Writing R > Extensions' manual, nor according to what I have been doing in > all of my packages for ca. 2 years: > > The rule I have in my mind is > > 1) NAMESPACE Import(s|From) \ >
2016 Apr 08
4
(no) circular dependency
Hi Mark, Uhm... sometimes this is not always possible. For example I have a package QCA which produces truth tables (all combinations of presence / absence of causal conditions), and it uses the venn package to draw a Venn diagram. It is debatable if one should assimilate the "venn" package into the QCA package (other people might want Venn diagrams but not necessarily the other QCA
2016 Sep 06
2
The use of match.fun
Dear gurus, I was utterly surprised to learn that one of my examples illustrating the need of match.fun() doesn't give me the expected result. center <- function(x,FUN) FUN(x) center(1:10, mean) mean <- 4 center(1:10, mean) Used to give me the error message "could not find function FUN". Now it just works, even though I didn't expect it to. I believe this is at least