similar to: question on using "warning.expression"

Displaying 20 results from an estimated 100000 matches similar to: "question on using "warning.expression""

2013 Oct 10
2
Help with expression()
Hi everyone, I am hoping someone can help with my attempted use of the expression function. I have a long series of text and variable to paste together including a degree symbol. The text is to be placed on my scatter plot using the mtext function. Using expression like this: changetext = expression(paste("Change from ",mini," to ", maxi, ":", diff
1999 Jul 06
2
eval(), expression()
Dear R-Users! My aim is to produce boxplots without the outliers included in the plot. I started to write a function that looks something like: myboxplot <-function(x,fa) { bpdata <- boxplot(x~fa,plot=FALSE) bpnames <- names(bpdata) for (JJ in bpnames) { command <- paste("bpdata$",JJ,"$out <- numeric(0)",sep=""); eval(command) }
2019 Aug 27
3
[Bug 1360] New: BUG: invalid expression type concat on invalid input "iifname . oifname p . q"
https://bugzilla.netfilter.org/show_bug.cgi?id=1360 Bug ID: 1360 Summary: BUG: invalid expression type concat on invalid input "iifname . oifname p . q" Product: nftables Version: unspecified Hardware: x86_64 OS: Debian GNU/Linux Status: NEW Severity: normal
2012 Nov 14
2
[LLVMdev] Generating code for Sequence expression
Hello. In order to practice compiler writing, I am implementing a simple compiler for the Tiger language. I am using llvm IR for the intermediate representation. Regarding llvm, I have started by reading the OCaml version of the LLVM Tutorial, where a compiler for the kaleidoscope language is built. The language I am implementing has a form of expression called "sequence expression".
2012 Sep 17
4
Using paste to create and evaluate a variable expression
Is it possible to use "paste" to write out an expression and evaluate it? Suppose I want to add two vectors X1 and X2, defined as follows: X1 <- 1:6 X2 <- 6:1 If I write the following it looks like what I want but is a character: noquote(paste(paste("X", 1, sep = ""), paste("X", 2, sep = ""), sep = "+")) Is there a way to tell R
2005 Oct 08
4
Warning: condition has length > 1
Hi - I was wondering if anyone came across a problem such as mine! I was trying to create a user-defined function, however, the results from calling the function are unexpected! When passing X parameter as a single value variable (x<-c(3)), everything works fine. However, when passing a parameter as a vector with multiple values (as the case in my code), the 'if condition' is only
2002 Mar 14
1
"evaluating expression 0" bug in R-1.4.1 (PR#1385)
Full_Name: Edward J. Neafsey Version: 1.4.1 OS: linux Submission from: (NULL) (147.126.192.93) R-1.4.1 failed to finish compiling building package `methods', as seen in output from make below. ============================================================================ Make output: ../../../library/methods/man/methods.Rd is unchanged make[4]: Entering directory
2004 Nov 08
1
can one evaluate an expression in a comment? (or insert resultsinto history?)
But that doesn't put the result into the history buffer, to be written to a file only later when I savehistory(filename). Bert Gunter also suggested ?capture.output and ?textConnection, but I cannot see how to get text into the history buffer as comments, but with evaluated expressions (values). I know how to use paste, sink, write, etc. but nothing that I can see inserts into the history
1998 Mar 26
0
S programming style & "missing(.)" [was "regarding bugs in barplot" on R-core]
[The part about S (S-plus and R being dialects of S) programming (at the end) makes me cc'ing this to R-devel. MM] On R-core, >>>>> "Paul" == Paul Murrell <paul@stat.auckland.ac.nz> writes: Paul> hi (i) the problem with the positioning of the legend in your Paul> barplot example: Paul>
2012 Jun 15
0
Syntax for nls optimization function
I am working on minimization of sum of squared errors for a problem that has 2 box-constrained parameters. I got the solution for this problem using "L-BFGS-B" method in optim function using an R code as res<-optim(par=c(parInit), fn=myFunction, method = c("L-BFGS-B"), lower = parMin, upper = parMax,
2023 Jan 16
2
return value of {....}
Richard, I sent my prior email too quickly: A slight addition to your code shows an important aspect of R, local vs. global variables: x <- 137 f <- function () { a <- x x <- 42 b <- x list(a=a, b=b) } f() print(x) When run the program produces the following: > x <- 137 > f <- function () { + a <- x + x <- 42 +
2004 Jan 03
0
expression parsing
Hi. I've noticed a problem with the expression parsing in Asterisk. If the variable is not defined, I will get a parse error. Yeah, there are ways around it, but I would think that it should return false if 0, null, or undefined. I would change it, but I have no idea about bison and I only have very basic C skills. There was a bug opened on this, and there was a valid work-around posted,
2005 Jan 24
2
using eval() with pre-built expression inside function
I'm trying to evaluate a pre-built expression using eval(), e.g. dataset <- data.frame(y = runif(30, 50,100), x = gl(5, 6)) # one like this mf <- expression(model.frame(y~x)) eval(mf, dataset, parent.frame()) # rather than this eval(expression(model.frame(y~x)), dataset, parent.frame()) In the example above there is no problem, the problem comes when I try to do a similar thing
2018 May 03
1
Calling the curve function with a character object converted into an expression
Typo: should be NULL not NUL of course An alternative approach closer to your original attempt is to use do.call() to explicitly evaluate the expr argument: w <- "1 + x^2" do.call(curve, list(expr = parse(text = w), ylab ="y")) Cheers, Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus
2010 Mar 10
1
expression(), mixed symbols and evaluated objects
Is it possible to mix symbols and evaluated objects inside the expression() function ? The following example shows what I am trying to achieve: for (m in 1:3) { plot(1:10); #just a place holder for the real plots title(expression(y = m * lambda)); } I want to actually evaluate the variable m but keep lambda as a symbol in the title. I tried to wrap an eval() around various subparts of
2004 Jun 22
0
SUMMARY: "elementary sapply question"
I am grateful to Andy Liaw, Douglas Grove, Brian Ripley, Tony Plate, Dirk Eddelbuettel and Sundar Dorai-Raj all of whom got together and drilled sense into my skull. I would like to take some effort into explaining what the question was, that I was grappling with, and the (nice) R way of solving the question. My apologies: I am still a victim of too many years of writing C, so I'm a bit dense
2005 Sep 22
3
warning.expression?
Hi! I'm trying to catch all warning-messages for special handling. It seems options (warning.expression=myfunc ()) can be used for that. However, the question is: How can I get at the actual warning in myfunc ()? Apparently in S, you can use .C("get_last_message") for that. Is there a similar mechanism in R? Thanks for your help! Thomas
2005 Sep 22
3
warning.expression?
Hi! I'm trying to catch all warning-messages for special handling. It seems options (warning.expression=myfunc ()) can be used for that. However, the question is: How can I get at the actual warning in myfunc ()? Apparently in S, you can use .C("get_last_message") for that. Is there a similar mechanism in R? Thanks for your help! Thomas
2005 Jun 22
1
substitute in a named expression
I have a 'named expression' like expr <- expression(rep(1,d)) and would like to replace the argument d with say 5 without actually evaluating the expression. So I try substitute(expr, list(d=5)) in which case R simply returns expr which when I 'evaluate' it gives eval(expr) Error in rep.default(1, d) : invalid number of copies in rep() I've looked at ?substitute and
2012 Sep 27
2
equivalent of Stata "by construct"
I am evaluating a switch from Stata to R. I don't need to extensive Statistical methods, but the main reason I am exploring the switch is the coding flexibility in R (e.g. Stata does not support linear/quadratic programming). I have been going over the R syntax and I had a quick question: In Stata, one has a very useful construction called "by", e.g. by month signal: gen xxx =