similar to: expression(), mixed symbols and evaluated objects

Displaying 20 results from an estimated 20000 matches similar to: "expression(), mixed symbols and evaluated objects"

2020 Oct 23
3
formula mungeing
Suppose I have a formula like this: f <- y ~ qss(x, lambda = lambdas[1]) + qss(z, lambdas[2]) + s I?d like a function, g(lambdas, f) that would take g(c(2,3), f) and produce the new formula: y ~ qss(x, lambda = 2) + qss(z, 3) + s For only two qss terms I have been using g <- function(lambdas, f){ F <- deparse(f) F <- gsub("lambdas\\[1\\]",lambdas[1],F) F
2009 Aug 03
2
boxplot( ) headers with Greek letters, values, and text
Hi - I've been using the option main=bquote(paste(mu==.(mu),", ",lambda==.(lambda),", ",truncation==.(truncation),", ",N[T]==.(n))) to produce a title when using the "plot" command - a title which includes variable names (two Greek) along with their values. The above option, however, does not work within the "boxplot" command. Any
2009 Jan 04
2
Combining greek letters with the contents of variables
Dear r-help list, I am trying to combine a greek letter lambda with the contents of a variable v in the title of a plot. However, it seems that having v inside the expression() function causes it not to be evaluated, on the other hand having expression(lambda) inside something else like paste causes it to be evaluated to a string. Here is an example of what I want to do:
2003 Sep 04
1
title expressions
The officially sanctioned way to put the expression "lambda_1 = x" in a title is something like this: title(substitute(lambda[1] == lamb, list(lamb = x))) but suppose I have two lambdas and would like something like "lambda_1 = x_1 , lambda_2 = x_2" to appear. What then? Undoubtedly I'm missing something blindingly obvious with lists, but having tried several
2020 Oct 23
0
formula mungeing
Recursively walk the formula performing the replacement: g <- function(e, ...) { if (length(e) > 1) { if (identical(e[[2]], as.name(names(list(...))))) { e <- eval(e, list(...)) } if (length(e) > 1) for (i in 1:length(e)) e[[i]] <- Recall(e[[i]], ...) } e } g(f, lambdas = 2:3) ## y ~ qss(x, lambda = 2L) + qss(z, 3L) + s On Fri, Oct
2010 Aug 31
1
Greek letters and variable values in lattice plot annotation
I'd like to annotate a lattice plot, e.g. xyplot, with text containing both Greek letters and variable values. In the base graphics plot command this can be accomplished with e.g. main = substitute(paste(lambda,"=",var),list(var=var)), where var is a variable that contains the value. When I try to do this in xyplot, I get the error message "object 'lambda' not
2019 Jan 22
2
Windows JIT-Client and Emulated TLS
Hello LLVM-World, yeah... It's me again and still with the never ending (but cool) task of jitting BC files under windows. My setup is: LLVM 7.0.0, with the corresponding Clang, Visual Studio 2017 (Clang integrated via "vix" installer) and my target is also windows x64. I create BC files with clang-cl and have currently a new test code, which has a static variable inside a lambda
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
2010 Feb 14
3
evaluate variable within expression - how?
Ein eingebundener Text mit undefiniertem Zeichensatz wurde abgetrennt. Name: nicht verf?gbar URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20100214/4b41a017/attachment.pl>
2007 Jul 18
1
Is there a facility in R similar to MatLab "syms" that allows using unevaluated numeric symbols in matrices?
Hi, I'm trying to use R to get eigenvalues and eigenvectors of a matrix whose elements are of the form (2 * lambda), -(lambda + mu), etc. I'd like R to treat this matrix as a numeric matrix without treating lambda and mu as variable names but rather as some sort of atomic quantities (and hence give eigenvectors in terms of mu and/or lambda). MatLab and Mathematica both do this,
2010 Jan 21
1
Displaying Equation With Numerator and Demomenator On A Plot...
Is there a way to display something like the quadratic equation, i.e. with a numerator and demonator on a plot? I think there is a way to create the equation in Latex, but wasn't sure if this format would translate to plotting. \begin{equation} ? x = \frac{b +/- sqrt(b^2 - 4*a*c)}{2*a} \end{equation} ? My searched turned up the following:
2009 Oct 19
1
How do I wrap a long mixed text/math expression in an axis label?
I would like to wrap a y-axis label onto two lines. My label is an expression containing both text and math symbols. I have looked at plotmath, strsplit(), strwrap(), deparse(), do.call(), substitute() and bquote(). Based on previous posts, I can get plain text to wrap. However, when I try these methods on my label, the exact string is returned, rather than evaluating the math symbols. My
2002 Apr 16
1
symbols in lattice
Dear plotting experts, I simply can't figure out how I can force bwplot to print mathematical symbols in the strips. Example: x <- rnorm(30) lab <- factor(c(rep("one", 10), rep("two", 10), rep("three", 10))) bwplot(~ x | lab) gives labels "one", "two", "tree" but I would like to change this into expression(lambda == 1),
2011 Jun 02
2
plotmath: paste string and expression [from a vector of expressions]
Dear all, I have a vector of expressions and would like to "paste" some string to it before using it in a plot: vars <- vector("expression", 2) vars[1] <- expression(alpha) vars[2] <- expression(beta) plot(0, 0, main=substitute(bold("Foo" ~~ VAR), list(VAR=vars[2]) )) Although I tried hard, I just can't figure out how to solve this. The title should be
2010 Oct 12
1
Displaying a variable as an expression into a plot label, but the variable has brackets
I'm attempting to insert variables as expressions into labels for my plots, but I'm running into the issue that characters in my labels aren't allowed in expressions, notably '[' and ']'. An input string of "[^3H]5-CT" needs to be displayed as [3H]5-CT with the 3 as superscript. But brackets aren't particularly liked in expressions. I know I can do
2020 Oct 21
1
Fitting Mixed Distributions in the fitdistrplus package
Dear Sirs, The below listed code fits a gamma and a pareto distribution to a data set danishuni. However the distributions are not appropriate to fit both tails of the data set hence a mixed distribution is required which has ben defined as "mixgampar" as shown below. library(fitdistrplus) x<- danishuni$Loss fgam<- fitdist(x,"gamma",lower=0) fpar<-
2007 Jul 23
2
persp and greek symbols in the axes labels
Hello, I am plotting a 3D function using persp and I would like to use greek symbols in the axes labels. I have found examples like this one on the web: plot(0,0,xlab=expression(kappa[lambda]),ylab=substitute(paste(phi,"=",true,sigma),list(true=5))) this works well with plot but not with persp: with the command persp(M,theta = -20,phi =
2006 May 25
4
Does TMail support Nested Multipart Messages? (Repost)
Hi, does anybody know if TMail supports nested multipart messages? I read a changelog that indicates so (http://dev.rubyonrails.org/svn/rails/trunk/actionmailer/CHANGELOG), but I haven''t been able to get it working so far. Maybe I am doing something wrong here? I attached the sample mail. Here is the code to parse it: require File.dirname(__FILE__) +
2008 Jun 19
3
YAPMQ - Yet Another PlotMath Question
Hello, I'm having trouble finding (remembering) how to pass values into text functions in plots, as demonstrated by: slope <- 45 ; plot(1:10) ; text(2, 7, labels = expression(45~degree)) ; text(2, 5, labels = paste(bquote(.(slope)), expression(degree))) Thanx, DaveT. ************************************* Silviculture Data Analyst Ontario Forest Research Institute Ontario Ministry of
2013 Aug 27
1
[plyr] Moving average filter with plyr
Dear all, I'm stuck with a problem using plyr to process a rather large junk of data. What I'm trying to do is applying a moving average to all the subparts of the dataframe (the example data can be found here https://dl.dropboxusercontent.com/u/2414056/testData.Rdata). require(plyr) load("testData.Rdata") applyfilter<-function(x){ return(filter(x,rep(1/5, times=5))) }