Displaying 20 results from an estimated 20000 matches similar to: "evaluating expressions with sub expressions"
2004 Mar 18
12
substitute question
Consider the following example:
# substitute a with b in the indicated function. Seems to work.
> z <- substitute( function()a+1, list(a=quote(b)) )
> z
function() b + 1
# z is an object of class call so use eval
# to turn it into an object of class expression; however,
# when z is evaluated, the variable a returns.
> eval(z)
function()a+1
Why did a suddenly reappear again
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 Mar 21
1
Forloop/ifelse program problem and list of dataframes
Hello R Community,
I don't post to these things often so excuse me if I stumble on my forum
etiquette. This is a complex problem for me, which may require two forum
entries, but I will try my best to be concise. Also, I am a self taught
coder, so if my code is not to convention, your constructive criticism is
always welcome.
I need to split up a data frame by participant (gpsarc -
2010 Jan 18
1
Sub-matrixes that are linked to the "Base matrix"
Hello,
I'm am in the process of trying to port a RATS functions to R and have
the problem, that RATS allows for the creation of submatrixes that are
linked to their basematrix.
Basically it should work like this:
a = matrix(1:(4*3),4,3)
a
# [,1] [,2] [,3]
# [1,] 1 5 9
# [2,] 2 6 10
# [3,] 3 7 11
# [4,] 4 8 12
# This of course doesnt work :)
b =
2013 Jul 18
1
Bland Altman summary stats for all column combinations
Hello,
I have the following data.frame
structure(list(Study = structure(c(1L, 2L, 3L, 4L, 5L, 6L, 7L,
8L, 9L, 10L, 11L, 12L, 13L, 14L, 15L, 16L, 17L, 18L, 19L, 1L,
2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L, 11L, 12L, 13L, 14L, 15L,
16L, 17L, 18L, 19L, 1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L,
11L, 12L, 13L, 14L, 15L, 16L, 17L, 18L, 19L, 1L, 2L, 3L, 4L,
5L, 6L, 7L, 8L, 9L, 10L, 11L, 12L, 13L, 14L,
2012 Jan 24
4
Question
We were looking at conducting a pilot program with Dell to virtualize our lab environments. We are specifically looking at Dell/Citrix provisioning servers. The OS in this setup is streamed from the server on every boot. I was curious if the R Project had any licensing stipulations in this type of setup. This is in the beginning phases and we wanted to answer some questions about licensing.
2011 Jun 24
2
mgcv:gamm: predict to reflect random s() effects?
Dear useRs,
I am using the gamm function in the mgcv package to model a smooth relationship between a covariate and my dependent variable, while allowing for quantification of the subjectwise variability in the smooths. What I would like to do is to make subjectwise predictions for plotting purposes which account for the random smooth components of the fit.
An example. (sessionInfo() is at
2011 Nov 10
5
Named components in a list
I'm studying lists and I came to an example where
> L
$name
[1] "Fred"
$wife
[1] "Mary"
$no.children
[1] 4
$child.ages
[1] 4 7 9
then following the instructions to extend the list with a new component, I
executed:
> L[5] <-list(NewName="something")
and the new list I got was:
> L
$name
[1] "Fred"
$wife
[1] "Mary"
2014 Apr 19
4
[LLVMdev] [NVPTX] Eliminate common sub-expressions in a group of similar GEPs
Hi,
We wrote an optimization that eliminates common sub-expressions in a group
of similar GEPs for the NVPTX backend. It speeds up some of our benchmarks
by up to 20%, which convinces us to try to upstream it. Here's a brief
description of why we wrote this optimization, what we did, and how we did
it.
Loops in CUDA programs are often extensively unrolled by programmers and
compilers,
2004 Jul 30
2
pairwise difference operator
There was a BioConductor thread today where the poster wanted to find
pairwise difference between columns of a matrix. I suggested the slow
solution below, hoping that someone might suggest a faster and/or more
elegant solution, but no other response.
I tried unsuccessfully with the apply() family. Searching the mailing
list was not very fruitful either. The closest I got to was a cryptic
chunk
2009 Jun 30
2
odd behaviour in quantreg::rq
Hi,
I am trying to use quantile regression to perform weighted-comparisons of the
median across groups. This works most of the time, however I am seeing some
odd output in summary(rq()):
Call: rq(formula = sand ~ method, tau = 0.5, data = x, weights =
area_fraction)
Coefficients:
Value Std. Error t value Pr(>|t|)
(Intercept) 45.44262 3.64706 12.46007
2010 Feb 01
5
regular expression submatch?
What is the simplest way to extract a matched subexpression?
Eg. in perl you can do
"hello world" =~ m/hello (.*)/
which would return 1(true) and set $1 to the matched subexpression "world".
--
View this message in context: http://n4.nabble.com/regular-expression-submatch-tp1459146p1459146.html
Sent from the R help mailing list archive at Nabble.com.
2009 Sep 09
1
Stats help with calculating between and within subject variance and confidence intervals
Hello.
I'm trying to find a way in R to calculate between and within subject
variances and confidence intervals for some analytical method
development data.
I've found a reference to a method in Burdick, R. K. & Graybill, F. A.
1992, Confidence Intervals on variance components, CRC Press. This
example is for Balanced Data confidence interval calculation from Pg
62. The data are
2008 Jul 26
1
Help with matrix
Hi
I have 3 vectors, say g1, g2 and f, where g1 and g2 contain the row and column indices of a matrix, with corresponding elements in f. How can I create a matrix containing the values in f ?
For example:
g1 g2 f
3 4 10
2 1 30
4 4 50
How can then get a matrix that looks as follows:
0 0 0 0
30 0 0 0
0 0 0 10
0 0 0 50
I am still learning R. I think reshape will
2009 Jan 19
1
sub and gsub treat \\ incorrectly (PR#13454)
Sub and gsub treat \\ replacement pattern incorrectly
I expect
sub("a","\\", "a", perl=T)
to produce
[1] "\"
instead it generates
[1] ""
On the other hand, if I run
sub("a","\\\\", "a", perl=T)
it correctly outputs
[1] "\\"
The same issue applies to gsub.
--please do not edit the information
2014 Apr 21
2
[LLVMdev] [NVPTX] Eliminate common sub-expressions in a group of similar GEPs
Hi Hal,
Thanks for your comments! I'm inlining my responses below.
Jingyue
On Sat, Apr 19, 2014 at 6:38 AM, Hal Finkel <hfinkel at anl.gov> wrote:
> Jingyue,
>
> I can't speak for the NVPTX backend, but I think this looks useful as an
> (optional) target-independent pass. A few thoughts:
>
> - Running GVN tends to be pretty expensive; have you tried EarlyCSE
2012 Sep 26
1
Creating x*y different contigency tables
Dear all,
I am trying to construct 25x31 different matrices of 2x2 dimension. Here
is the problem:
we have the following matrix
matrix(c(54+s0,
43+s1, 56-s0, 67-s1), nrow=2, ncol=2, byrow=T)
the values for s0 and s1 are c(0:24) and c(0:31), respectively.
I wrote the following code without the desired results
2006 Aug 24
1
Using a 'for' loop : there should be a better way in R
I need to apply a yearly inflation factor to some
wages and supply some simple sums by work category. I
have gone at it with a brute force "for" loop approach
which seems okay as it is a small dataset. It looks
a bit inelegant and given all the warnings in the
Intro to R, etc, about using loops I wondered if
anyone could suggest something a bit simpler or more
efficent?
Example:
2009 Mar 11
3
Converting a dataframe to a matrix
If I have a dataframe which is organized like this:
name color likes?
1 sally red 0
2 sally blue 1
3 sally green 1
4 jake red 0
5 jake blue 1
6 jake green 1
7 tom red 1
8 tom blue 0
9 tom green 0
And I want to create a matrix in the form:
red blue green
sally 0 1 1
jake 0 1 1
tom 1 0 0
Are there any built-in
2008 Dec 09
1
creating standard curves for ELISA analysis
Hello R guru's
I am a newbie to R, In my research work I usually generate a lot of ELISA
data in form of absorbance values. I ususally use Excel to calculate the
concentrations of unknown, but it is too tedious and manual especially when
I have 100's of files to process. I would appreciate some help in creating
a R script to do this with minimal manual input. s A1-G1 and A2-G2 are