Displaying 20 results from an estimated 4000 matches similar to: "Everyone-- the scoop on Bison/Flex --"
2006 Oct 27
2
all.names() and all.vars(): sorting order of functions' return vector
Dear list-subscriber,
in the process of writing a general code snippet to extract coefficients
in an expression (in the example below: 0.5 and -0.7), I stumbled over
the following peculiar (at least peculiar to me:-) ) sorting behaviour
of the function all.names():
> expr1 <- expression(x3 = 0.5 * x1 - 0.7 * x2)
> all.names(expr1)
[1] "-" "*" "x1"
2006 Jul 18
2
I think this is a bug
Hello!
I work with:
R : Copyright 2006, The R Foundation for
Statistical Computing
Version 2.3.1 (2006-06-01)
On Windows XP Professional (Version 2002) SP2
I think there is a bug in the conditional
execution if (expr1) {expr2} else {expr3}
If I try:
"if (expr1) expr2 else expr3"
it works well but when I put the expression expr2
and expr3 between {} I receive an error message
1997 Apr 30
2
R-beta: Small problems with R0.49
A non-text attachment was scrubbed...
Name: not available
Type: text
Size: 1856 bytes
Desc: not available
Url : https://stat.ethz.ch/pipermail/r-help/attachments/19970430/db1498ee/attachment.pl
2001 May 30
2
environments
I would like to be able, inside a function, to create a new function, and
use it as part of a formula as an argument to, say, gnls or nlme. for
example:
MyTop <- function(data=dta) {
Cexp <- function(dose,A,B,m){...}
Model <- as.formula(paste("y","~ Cexp(",paste(formals(Cexp),collapse
=", "),")"))
MyCall <-
2023 Jan 11
1
return value of {....}
I am more than a little puzzled by your question.
In the construct {expr1; expr2; expr3} all of the
expressions expr1, expr2, and expr3 are evaluated,
in that order. That's what curly braces are FOR.
When you want some expressions evaluated in a
specific order, that's why and when you use curly
braces. If that's not what you want, don't use them.
Complaining about it is like
2002 Aug 07
2
Constructing titles from list of expressions
Hello!
I have the following problem:
I have a function to construct three surfaceplots with a marker for an optimum,
each of the plots has as title paste("Estimated ",pred.var.lab," for
",var.lab[1]," vs. ",var.lab[2],sep="") with different var.lab[1,2] each time.
My problem is now that I need to allow for plotmath expressions in the
variables pred.var.lab
2023 Jan 13
1
return value of {....}
R's
{ expr1; expr2; expr3}
acts much like C's
( expr1, expr2, expr3)
E.g.,
$ cat a.c
#include <stdio.h>
int main(int argc, char* argv[])
{
double y = 10 ;
double x = (printf("Starting... "), y = y + 100, y * 20);
printf("Done: x=%g, y=%g\n", x, y);
return 0;
}
$ gcc -Wall a.c
$ ./a.out
Starting... Done: x=2200, y=110
I don't like that
2005 Jun 02
2
bison/flex version warning
Hi,
(I seem to be having some trouble getting messages to post on the list so
I may be duplicating an earlier post. Apologies if this is the case.)
I am compiling CVS tip Asterisk on a fresh CentOS 3.4 install. I got
this warning:
make ast_expr.a
make[1]: Entering directory `/usr/src/asterisk'
bison -v -d --name-prefix=ast_yy ast_expr.y -o ast_expr.c
2023 Jan 09
5
return value of {....}
Dear members,
I have the following code:
> TB <- {x <- 3;y <- 5}
> TB
[1] 5
It is consistent with the documentation: For {, the result of the last expression evaluated. This has the visibility of the last evaluation.
But both x AND y are created, but the "return value" is y. How can this be advantageous for solving practical problems?
2004 Jul 12
8
Gogoif with variables acting funny?
Using an example provided by "The Hitchhiker's Guide to Asterisk", I
made the following addition to my extensions.conf file:
[inbound-analog]
exten => s,1,Wait(1)
exten => s,2,SetVar(counter=0)
exten => s,3,Answer()
exten => s,4,Wait(1)
exten => s,5,DigitTimeout(15)
exten => s,6,ResponseTimeout(10)
2009 Dec 09
4
equivalent of ifelse
Hi,
Is there any equivalent for ifelse (except if (cond) expr1 else expr2) which takes an atomic element as argument but returns vector since ifelse returns an object of the same length as its argument?
x = c(1,2,3)
y = c(4,5,6,7)
z = 3
ifelse(z <= 3,x,y)
would return x and not 1
thanks
2003 Jan 31
2
Varying texts in expression(paste())
Hi,
I am using R a lot to make plots relating to radioactivity, I am often using
expression() to label the plots with nuclide names written with
superscripts, e.g.
expression(paste("Releases of ", { }^{99},Tc," (TBq/year)"))->ywtext
But, is there any simple way to change the number and name of the nuclide
through a variable? I tried
nuccode=expression({ }^{99},Tc)
2023 Jan 12
4
return value of {....}
Hello Akshay,
R is quite inspired by LISP, where this is a common thing. It is not in fact that {...} returned something, rather any expression evalulates to some value, and for a compound statement that is the last evaluated expression.
{...} might be seen as similar to LISPs (begin ...).
Now this is a very different thing compared to {...} in something like C, even if it looks or behaves
2014 May 01
3
How to test if an object/argument is "parse tree" - without evaluating it?
This may have been asked before, but is there an elegant way to check
whether an variable/argument passed to a function is a "parse tree"
for an (unevaluated) expression or not, *without* evaluating it if
not?
Currently, I do various rather ad hoc eval()+substitute() tricks for
this that most likely only work under certain circumstances. Ideally,
I'm looking for a isParseTree()
2011 Apr 04
1
Deriving formula with deriv
Dear list,
Hi,
I am trying to get the second derivative of a logistic formula, in R summary
the model is given as :
###
>$nls
>Nonlinear regression model
>model: data ~ logistic(time, A, mu, lambda, addpar)
>data: parent.frame()
> A mu lambda
>0.53243 0.03741 6.94296
###
but I know the formula used is
#
2005 Jul 12
2
Puzzled at ifelse()
I have a situation where this is fine:
> if (length(x)>15) {
clever <- rr.ATM(x, maxtrim=7)
} else {
clever <- rr.ATM(x)
}
> clever
$ATM
[1] 1848.929
$sigma
[1] 1.613415
$trim
[1] 0
$lo
[1] 1845.714
$hi
[1] 1852.143
But this variant, using ifelse(), breaks:
> clever <- ifelse(length(x)>15, rr.ATM(x, maxtrim=7), rr.ATM(x))
2012 Apr 13
1
[PATCH] libxl/build: print a pretty message if flex/bison are needed but not found
This patchs adds better support for both Flex and Bison, which might be needed
to compile libxl. Now configure script sets BISON and FLEX Makefile vars if
bison and flex are found, but doesn''t complain if they are not found.
Also, added some Makefile soccery to print a nice error message if Bison or Flex
are needed but not found.
Please run autogen after applying this patch.
2005 Jun 29
0
[LLVMdev] Including flex/bison output in cvs
On Mon, 27 Jun 2005, Alexander Friedman wrote:
> Hi all,
> have flex/bison. Most (but not all) unix boxes have them, but almost
> no windows boxes have them. This requires either
>
> 1) Forcing the user to dowload flex/bison (bad)
> 2) Distributing flex/bison with the front-end (not as bad, but a pain)
>
> 3) or, and this seems like a simple fix, just distribute the output
2005 Jun 27
2
[LLVMdev] Including flex/bison output in cvs
Hi all,
At the moment, LLVM includes the .l, .y sources that are compiled by
flex and biston via make. This is fine for most unix developers. For
windows developers, it's a bit more of a pain to download flex/bison,
but is still a one-time thing.
However, anyone releasing an llvm frontend will require their users to
have flex/bison. Most (but not all) unix boxes have them, but almost
no
2005 Jul 01
1
[LLVMdev] Including flex/bison output in cvs
On 6/29/05, Chris Lattner <sabre at nondot.org> wrote:
> On Mon, 27 Jun 2005, Alexander Friedman wrote:
> > Hi all,
> > have flex/bison. Most (but not all) unix boxes have them, but almost
> > no windows boxes have them. This requires either
> >
> > 1) Forcing the user to dowload flex/bison (bad)
> > 2) Distributing flex/bison with the front-end (not as