similar to: Putting an index explicitly into function code --- a curiosity.

Displaying 20 results from an estimated 6000 matches similar to: "Putting an index explicitly into function code --- a curiosity."

2012 May 19
1
Names of Greek letters stored as character strings; plotmath.
I had such good luck with my previous question to r-help, (a few minutes ago) that I thought I would try again with the following query: > Suppose I have > > xNm <- "gamma" > > I would like to be able to do > > plot(1:10,xlab = <something involving xNm">) > > and get the x axis label to be the Greek letter gamma > (rather than the
2009 Mar 25
2
Listing of LAPACK error codes
Professor Ripley commented on LAPACK error codes: https://stat.ethz.ch/pipermail/r-help/2007-March/127702.html and says "Internal LAPACK errors are usually problems with arithmetic accuracy, and as such are compiler- and CPU-specific." Is there a listing for the error codes from Lapack routine 'dsyevr'? Especially I am interested about the meaning and handling of error codes 1
2012 May 19
1
Catenating strings involving plotmath symbols.
In the context in which I am actually working it is necessary for me to build parts of a text string to place on a plot in two separate stages. The following toy example illustrates what I am trying to do: L1 <- substitute(list(paste("Bias in ", gamma,", "))) L2 <- substitute(list(beta==b0),list(b0=300)) plot(1:10,main=L1) # Works fine. plot(1:10,main=L2) # Works fine.
2010 Jan 25
2
Two == expressions in bquote
Hi, I want to put text on a plot containing something like: a = b^2 = <squared numeric value of b> using bquote. Example: mu = 5 plot(1:10,1:10) text(2,8, bquote(delta == mu^2)) # This works text(2.5,8, bquote(phantom(0) == .(mu^2))) # but is unpredictable text(2,8, bquote(delta == mu^2 == .(mu^2))) # This doesn't work The last text function returns the error:
2010 Aug 01
3
Constructing arguments for plotmath
Colleagues, I am encountering difficulty adding formatted text to a graphic. Specifically, I want to add a superscript in the middle of a text string but I would like to format the text string on the fly. The commands: plot(1,1) ARG <- bquote('TEXT'^'\u00ae') mtext(ARG, line=-2, side=1) yield the desired output. However, my goal is to paste together a string, then pass
2009 Jun 03
1
Would like to add this to example for plotmath. Can you help?
Greetings: I would like comments on this example and after fixing it up, I need help from someone who has access to insert this in R's help page for plotmath. I uploaded a drawing http://pj.freefaculty.org/R/Normal-2009.pdf that is created by the following code http://pj.freefaculty.org/R/Normal1_2009_plotmathExample.R This will be a good addition to the plotmath help page/example.
2009 Nov 20
1
How to concatenate expressions
Dear R-users, I am developing a plotting function, which receives expressions and character/numerical vectors as part of the many input arguments and which tries to concatenate them before displaying the result to the plot. I currently cannot find a way to make this concatenation works. I have read several posts in the list that solved this problem by pasting the different elements together
2009 Sep 02
2
combining grid.text, expression and variables
Dear R-users, I am trying to use the grid.text and expression functions to display several character strings and plotmath text on a viewport. Some strings can include a variable portion (PI.limits in the following example), which I thought could be implemented by combining the bquote and the expression functions. Unfortunately, my expressions do not seem to be evaluated. I would greatly
2008 Oct 02
1
using bquote to construct function
Hi, R-help, (sessionInfo at the end) I'm trying to construct a function using bquote and running into a strange error message. As an example, what I would like to do is this: z <- 2 eval(bquote(function(x, y) { x^.(z) + y }))(2, 3) However, I get the following: Error in eval(expr, envir, enclos) : invalid formal argument list for "function" However, if I change the
2006 Feb 10
1
?bquote
?bquote says it returns an expression but, in fact, it typically (though not always) returns a call object: > class(bquote(a+b)) [1] "call" > class(bquote(1)) [1] "numeric"
2008 Nov 19
2
do.call and plotting functions ...
I'm trying to write a simple wrapper for plotting functions to make them print to postscript, something like ploteps <- function(file, plotFunction, ...) { args <- list(bquote(...)) # prepare postscript device do.call(plot, args) # close postscript device } I have inserted the bquote otherwise I get a lot of numbers in the plot when I plot/hist something. But if I invoke
2011 Jun 23
1
Saved EPS does not match screen when using bquote(.(i))
Here's a fairly minimal-case example in which the saved EPS does not match the screen. The error comes when using bquote(.(i)) instead of bquote(1), as demonstrated by the two minimally different cases below. Very strange. Any clues as to why? #---------------- begin ------------------- # Version A. X axis labels have subscripts as constants. EPS is correct. windows() layout( matrix( 1:2 ,
2015 Feb 11
2
[PATCH] Fix for client certificate validation does not work
Hi all, As I reported earlier (with a typo in the work [BUG]) client certification validation *does not* work even if you do everything exactly according to all documentation and attempts at helpful advice. I have seen this issue with both startssl.com and self-signed certificates, and based on what I've seen from searching the web, this is a problem that has gotten little attention because
2006 Jul 30
3
main= bquote(paste("Results for ", beta, "3", ==.(b1)))) doesn't work.
Hi, I need to plot the beta as the symbol, followed by the index 3 as the title of a graph. This code works> main= bquote(paste("Results for ", beta ==.(b1)) but I also need the index 3. I tried (simplified): >plot(x,y, main= bquote(paste("Results for ", beta, "3", ==.(b1)))) and a few other versions, but I can not get it to run properly. Any help would
2007 Jul 19
1
substitute and expression (Peter Dalgaard)
In this connection, note the following > a4 <- 4 > plotThis <- bquote(alpha==.(a), list(a=a4)) > do.call(plot, list(1:10, main=do.call(expression, c(plotThis)))) > do.call(plot, list(1:10, main=do.call(expression, plotThis))) Error in do.call(expression, plotThis) : second argument must be a list > ## Whereas plotThis has class "call", c(plotThis) has class
2013 Jan 04
1
Using bquote to create names a for a list
Hello, How would i use bquote to create names for a list. e.g. to create list(a=10) bquote(list(.(X)=10), list(X="a")) does not work. The best i could come up with is bquote({ a=list(10);names(a)=.(X); a}, list(X="a")) which is quite ugly. Is there an elegant way to solve this? Regards Saptarshi [[alternative HTML version deleted]]
2011 Mar 31
1
Italicized title from index
Hi all! I've written a handy script that uses a for loop to allow me to generate a large number of figures and statistical outputs for a large dataset. I am using indexing to retrieve a species name for the title of my graphs- which worked fine. However, I need to italicize these species names. I originally used the paste function, and had no problems with indexing: *main=paste("Yield
2015 Jul 15
3
bquote/evalq behavior changed in R-3.2.1
In 3.1.2 eval does not store the result of the bquote-generated call in the given environment. Interestingly, in 3.2.1 eval does store the result of the bquote-generated call in the given environment. In other words if I run the given example with eval rather than evalq, on 3.1.2 "x" is never stored in "fenv," but it is when I run the same code on 3.2.1. However, the given
2006 Jul 25
5
greek letters, text, and values in labels
Hello, I want to have a title that will look something like: "Results for \theta=2.1", given that I have a variable theta=2.1, and \theta should show on the screen like the greek letter. I've tried a lot of things: theta <- 2.1 plot(1:10, main=expression(paste("Results for", theta, "=", eval(theta)))) or using bquote plot(1:10, main=paste("Results for
2008 Apr 02
1
Trouble combining plotmath, bquote, expressions
I'm using R-2.6.2 on Fedora Linux 9. I've been experimenting with plotmath. I wish it were easier to combine expressions in plotmath with values from the R program itself. There are two parameters in the following example, the mean "mymean" and standard deviation "mystd". I am able to use bquote to write elements into the graph title like mu = mymean and R will