Displaying 20 results from an estimated 242 matches for "res2".
Did you mean:
res
2009 Nov 16
3
Cluster analysis: hclust manipulation possible?
I am doing cluster analysis [hclust(Dist, method="average")] on
data that potentially contains redundant objects. As expected,
the inclusion of redundant objects affects the clustering result,
i.e., the data a1, = a2, = a3, b, c, d, e1, = e2 is likely to
cluster differently from the same data without the redundancy,
i.e., a1, b, c, d, e1. This is apparent when the outcome is
visualized
2004 Jun 01
1
swapping with data.frame
Hi there,
I have some data which are convenient to enter as lists. For example:
t1<-list(fname="animal1",testname="hyla",dspkr="left",res1=39.7,res2=15.0)
t2<-list(fname="animal1",testname="bufo",dspkr="left",res1=14.4,res2=56.1)
t3<-list(fname="animal2",testname="hyla",dspkr="right",res1=22.6,res2=11.8)
I would like to generate a dataframe, but *not* the way this approach
works...
2011 May 19
3
problem with optim()
...mber, and 1 matrix) using optim() and BFGS method. Here is my code:
# fonction to maximize
g=function(x)
{
x1 = x[1:ncol(X)]
x2 = x[(ncol(X)+1)]
x3 = matrix(x[(ncol(X)+2):(ncol(X)+1+ncol(X)*ncol(Y))],nrow=ncol(X),ncol=ncol(Y))
x4 = x[(ncol(X)+1+ncol(X)*ncol(Y)+1):length(x)]
res1=rep(0,nrow(X))
res2=matrix(0,nrow=nrow(X),ncol=ncol(Y))
log.res2=matrix(0,nrow=nrow(X),ncol=ncol(Y))
res2.b=rep(0,nrow(X))
res3 = rep(0,nrow(X))
res3.b = rep(0,nrow(X))
for (i in 1:nrow(X))
{
res1[i]=1/(1+exp(-t(x1)%*%X[i,]-x2))
for (t in 1:ncol(Y))
{
res2[i,t] = ((1-(1+exp(-t(x3[,t])%*%X[i,]-x4[t]))^(-1))^(abs(Y[i,t]...
2018 Dec 18
2
should we do this time-consuming transform in InstCombine?
...= select i1 %cmp, i32 %mul, i32 %mul2
Source code for above pattern:
return (a*b) >=0 ? (a*b) : -a*b;
Currently, llvm(-O3) can not recognize this as abs(a*b).
I initially think we could do this in instCombine phase in opt. Below is
what I think:
%res = OP i32 %b, %a
%sub = sub i32 0, %b
%res2 = OP i32 %sub, %a
We could do the transform:
%res2 = OP i32 %sub, %a ==> %res2 = sub i32 0, %res
Then we can get the advantage:
1: if %res2 is the only user of %sub, %sub can be eliminated;
2: if %res2 is not the only user of %sub, we could change some heavy
instruction like div to sub;
3:...
2013 Feb 01
29
cumulative sum by group and under some criteria
Thank you very much for your reply. Your code work well with this example.
I modified a little to fit my real data, I got an error massage.
Error in split.default(x = seq_len(nrow(x)), f = f, drop = drop, ...) :
Group length is 0 but data length > 0
On Thu, Jan 31, 2013 at 12:21 PM, arun kirshna [via R] <
ml-node+s789695n4657196h87@n4.nabble.com> wrote:
> Hi,
> Try this:
>
2002 May 02
2
a question
Hi,
I have a program written in R which is good on the version 1.2, but for
the fallowing versions of R, an error always is at the same place.
That is at the level of the fallowing line:
Sur<-
getInitial(res2[m:M,2]~SSasymp(res2[m:M,1],Asymp,resp0,lrc),data=res2)
Error in eval(expr,envir,enclos):numeric envir arg not of length one
I don't know at all this langage for the instant.
Thanks,
Christelle
-------------------------------------------------------------
NetCourrier, votre bureau virtue...
2018 Dec 18
2
should we do this time-consuming transform in InstCombine?
Hi Roman,
Thanks for your good idea. I think it can solve the abs issue very well. I
can continue with my work now^-^.
But if it is not abs and there is no select,
%res = OP i32 %b, %a
%sub = sub i32 0, %b
%res2 = OP i32 %sub, %a
theoretically, we can still do the following transform for the above
pattern:
%res2 = OP i32 %sub, %a ==> %res2 = sub i32 0, %res
Not sure whether we can do it in instCombine.
Thanks.
BRS//
Chen Zheng
Power Compiler Backend Developer
From: Roman Lebedev <lebedev.ri...
2012 Jan 04
1
function in R for my exercise
...else res<-NA
return(res)}
Then, I tried to include some lines to take this "swap" function into
account by "splitting" somehow my function in 2:
myFunc<- function(x,y,z,swap)
{ res1= NULL
res2=NULL
if(z =="plus") res1=x+y
else if(z=="minus") res1=x-y
else if(z== "multiply") res1=x*y
else if(z=="divide") res1=x/y
else res1<-NA
if(z ==...
2013 Jun 10
4
Combining CSV data
Hello R community,
I am trying to combine two CSV files that look like this:
File A
Row_ID_CR, Data1, Data2, Data3
1, aa, bb, cc
2, dd, ee, ff
File B
Row_ID_N, Src_Row_ID, DataN1
1a, 1, This is comment 1
2a, 1, This is comment 2
3a,
2006 Aug 18
1
multivariate analysis by using lme
Dear R users,
I have a data structure as follows:
id two res1 res2 c1 c2 inter
1 -0.786093166 1 0 1 2 6
3 -0.308495749 1 0 0 1 2
5 -0.738033048 1 0 0 0 1
7 -0.52176252 1 0...
2000 Jul 05
1
Tukey.aov with split-plot designs
...,26,28,18,20,34,28,16,10,18,20,14,34,22,30,44,30)
Stv.df <-
data.frame(rt=data,subj=factor(rep(paste("subj",1:5,sep=""),4)),drug=factor(
rep(paste("drug",1:4,sep=""),c(5,5,5,5))))
res0 <- aov(rt~drug,data=Stv.df)
res1 <- aov(rt~drug+subj,data=Stv.df)
res2 <- aov(rt~drug+Error(subj/drug),data=Stv.df)
res0$resid works
resid(res0) works
res0$df.residual works
res1$resid works
resid(res1) works
res1$df.residual work
res2$resid doesn't work and reports NULL
resid(res2) doesn't work and reports NULL
res2$df.residual doesn't work and repo...
2013 Mar 22
3
Distance calculation
...t2[i,],x); abs((x1$Peak1.v.[1]-x1$Peak1.v.[2])*(x1$Peak1.t.[1]-x1$Peak1.t.[2]))+abs((x1$Peak2.v.[1]-x1$Peak2.v.[2])*(x1$Peak2.t.[1]-x1$Peak2.t.[2]))+abs((x1$Npeak1.v.[1]-x1$Npeak1.v.[2])*(x1$Npeak1.t.[1]-x1$Npeak1.t.[2]))+abs((x1$Npeak2.v.[1]-x1$Npeak2.v.[2])*(x1$Npeak2.t.[1]-x1$Npeak2.t.[2]))}))))
res2<-do.call(cbind,lapply(seq_len(ncol(res1)),function(i) c(c(tail(res1[seq(1,i,1),i],-1),0),res1[-c(1:i),i])))
row.names(res2)<-1:nrow(res2)
?res2
#????? [,1]???? [,2]???? [,3]???? [,4]???? [,5]
#1?? 0.0000?? 0.0000?? 0.0000 379.1364?? 0.0000
#2?? 0.0000?? 0.0000?? 0.0000 312.8267?? 0.0000
#3??...
2013 Oct 14
1
R Help-how to use sapply w/tapply
Hi,
(Please use ?dput() to share the example dataset. Avoid using images to show dataset. Also, please read the posting guide esp. regarding home work, assignments etc.)
res <- sapply(Gene[,-1],function(x) tapply(x,list(Gene$Genotype),mean))
#or
res2 <-? aggregate(.~Genotype, data=Gene,mean)
#or
library(plyr)
?res3 <- ddply(Gene,.(Genotype),numcolwise(mean))
identical(res2,res3)
#[1] TRUE
resNew <- data.frame(Genotype=rownames(res),res,stringsAsFactors=FALSE)
?attr(resNew,"row.names") <- attr(res2,"row.names&quo...
2003 Aug 21
4
anova(lme object)
Hi,
I use lme to fit models like
R> res1 <- lme(y~A+B, data=mydata, random=~1|subject)
R> res2 <- lme(y~B+A, data=mydata, random=~1|subject)
(only difference between these two models are the
sequence in which the indep variables are written in
formula)
where y is continuous and A, B, and subject are
factors. To get ANOVA table I used
R> anova(res1)
R> anova(res2)
and found ANOVA...
2012 Nov 10
4
help on date dataset
Hi everybody,
I am beginer in R and I need your precious help.
I want to create a small function in R as in sas to retrieve date.
I have a file with data that import in R.
DATE PAYS nb_pays.ILI.
1 24/04/2009 usa 0
2 24/04/2009 usa 0
3 24/04/2009 Mexique 0
4 24/04/2009
2012 Jun 11
3
Simple Binning of Values
Hello
I am very new to R. I have an R task to complete that I have not been able to find a straightforward answer to as of yet. I have a list of values. I would like to count the number of values that are in one bin, the number that fall in the next bin, etc.
For example
My input file is: 123 48 342 442 43 232 32 129 191 147
I would like the output to be similar to:
0-100 3
100-200 4
2007 Nov 12
2
strange `nls' behaviour
..., b=1, c=1))
call.fitfunc <-
c(list(fitfunc), as.name("a"), as.name("b"), as.name("c"), as.name("x"))
call.fitfunc <- as.call(call.fitfunc)
frml <- as.formula("y ~ eval(call.fitfunc)")
#"computed" call of nls:
res2 <- nls(frml, start = c(a=1, b=1, c=1))
list(res1 = res1, res2 = res2)
}
#-----------------------------------------
the argument `n' defines the number of (simulated) data
points x/y which are going to be fitted by some model ( here
y ~ a*exp(-b*x)+c )
the first call to `nls' i...
2007 Feb 22
4
Crosstabbing multiple response data
Using R version 2.4.1 (2006-12-18) on Windows, I have a dataset which resembles this:
id att1 att2 att3
1 1 1 0
2 1 0 0
3 0 1 1
4 1 1 1
ratings <- data.frame(id = c(1,2,3,4), att1 = c(1,1,0,1), att2 = c(1,0,0,1), att3 = c(0,1,1,1))
I would like to get a cross tab of counts of co-ocurrence, which might resemble this:
2003 Oct 07
1
[PATCH] allow announcements in app_dial
Hi.
Since a customer requested us that feature, I wrote this
little patch for app_dial to allow to play an
announcement to the called party, as soon he answers.
you can define the file to play in the dial() option,
using A(filename).
for example:
exten => blah,1,Dial(Zap/blah,30,rA(/my/own/announce)Tt)
that doesn't break anything ...
feel free to blame me for anything bad this patch
2011 Jan 19
0
Error Moran's test : reconsider test arguments
Dear
R-users,
I was
wondering if someone could give me some advices on the following problem.
I tried to
apply moran’s test to a small dataset and couldn’t succeed, here is the error
message:
mor <- moran.test(x, res2)
Avis dans
moran.test(x, res2) :
Out-of-range p-value: reconsider test arguments
mor
Moran's I test under randomization
data: x
weights: res2
Moran I statistic standard deviate = NaN, p-value = NA
alternative hypothesis: greater
sample estimates:
Moran I statistic ...