Displaying 9 results from an estimated 9 matches for "indx1".
Did you mean:
indx
2013 Jun 10
2
please check this
...275 278 293 301 327 331 335 339 367 369 371 379
#[20] 413 415 417 441 459 461 477 479 505
res10PercentSub1<-subset(res10Percent[which(duplicated(res10Percent)),],dummy==1)? #most of the duplicated are dummy==1
res10PercentSub0<-subset(res10Percent[which(duplicated(res10Percent)),],dummy==0)
?indx1<-as.numeric(row.names(res10PercentSub1))
indx11<-sort(c(indx1,indx1+1))
indx0<- as.numeric(row.names(res10PercentSub0))
?indx00<- sort(c(indx0,indx0-1))
indx10<- sort(c(indx11,indx00))
?nrow(res10Percent[-indx10,])
#[1] 452
?res10PercentNew<-res10Percent[-indx10,]
?nrow(subset(re...
2013 Apr 14
1
possible loop problem
...dat1<- read.table(text="
separator,tissID
>,>,2
,2,1
,6,5
,11,13
>,>,4
,4,9
,6,2
,7,3
,21,1
,23,58
,25,9
,26,4
>,>,11
,1,12
>,>,21
,4,1
,11,3
",sep=",",header=TRUE,stringsAsFactors=FALSE,row.names=NULL)
indx<-which(grepl(">",dat1[,1]))
indx1<-diff(c(indx,nrow(dat1)+1))
res1<-do.call(rbind,lapply(seq_along(indx),function(i) {x1<-dat1[indx[i]:(indx[i]+(indx1[i]-1)),];x1[-1,1]<- x1[1,3];x1}))
res2<- as.matrix(res1[,-1])
row.names(res2)<- res1[,1]
?res2
#?? separator tissID
#>? ">"?????? " 2"?...
2013 Oct 04
3
Trying to avoid nested loop
Dear R users.
I'm trying to avoid using nested loops in the following code but I'm not sure how to proceed. Any help would be greatly appreciated.
With regards,Phil
X = matrix(rnorm(100), 10, 10)
## Version with nested loopsresult = 0
for(m in 1:nrow(X)){ for(n in 1:ncol(X)){ if(X[m,n] != 0){ result = result + (X[m,n] / (1 + abs(m - n))) } }}
## No loop-sum(ifelse(M
2013 Sep 08
1
Sub setting multiple ids based on a 2nd data frame
HI Matt,
I changed the dates a little bit to show dates that are outside the range in dataset B.
A<- read.table(text="
ID????? Date???????????? Depth? Temp
1?????? 2002-05-12?????????? 10 12
1?????? 2003-05-13?????????? 10 12
1?????? 2003-05-14?????????? 10 12
1?????? 2004-04-15?????????? 10 12
2?????? 2002-05-16?????????? 10 12
2?????? 2002-12-17?????????? 10 12
2??????
2013 Sep 27
0
Best and Worst values
...nge the data #accordingly.
indx<-cbind(rep(seq_len(nrow(resFinal)),2),rep(c(5,3),each=250))? ## 5,3 represents the column numbers Predict in resFinal
indx2<-c(rep(seq(1,100,by=2),each=5),rep(seq(2,100,by=2),each=5))
indx3<- indx[order(indx2),]
resNew[,2]<-as.numeric(resFinal[indx3])
indx1<-cbind(rep(seq_len(nrow(resFinal)),2),rep(c(6,4),each=250)) #6,4 represent the columns Actual in resFinal
indx4<- indx1[order(indx2),]
resNew[,3]<-as.numeric(resFinal[indx4])
colnames(resNew)<- c("Date","Predict","Actual")
CorRes<-ddply(resNew,.(Date),...
2013 Nov 08
2
making chains from pairs
Hello,
having a data frame like test with pairs of characters I would like to
create chains. For instance from the pairs A/B and B/I you get the vector A
B I. It is like jumping from one pair to the next related pair. So for my
example test you should get:
A B F G H I
C F I K
D L M N O P
> test
V1 V2
1 A B
2 A F
3 A G
4 A H
5 B F
6 B I
7 C F
8 C I
9 C K
10 D L
2009 Apr 21
4
My surprising experience in trying out REvolution's R
...mple.y(b, D.u, x, z); #this is the sampling stage
obj1 <- mle(b, D.u, x, yy, z, F, F, n.iter=50);
obj2 <- mle(b, D.u, x, yy, z, T, F, n.iter=50);
obj1$uu - obj2$uu
}
##################################################
mle <- function(b, D.u, x, y, z, indx1, indx2, n.iter)
{
u.mean.initial <- array( 0, c(n.random, m) );
for(i in 1:n.iter)
{
obj <- sample.u(b, D.u, x, y, z, u.mean.initial);
if(indx1) b <- b - solve(obj$Hessian, obj$score);
if(indx2) D.u <- obj$uu;
u.mean.initi...
2013 Jun 07
4
matched samples, dataframe, panel data
I R-helpers
#I have a data panel of thousands of firms, by year and industry and
#one dummy variable that separates the firms in two categories: 1 if the firm have an auditor; 0 if not
#and another variable the represents the firm dimension (total assets in thousand of euros)
#I need to create two separated samples with the same number os firms where
#one firm in the first have a corresponding
2013 Feb 15
10
reading data
Hi,
#working directory data1 #changed name data to data1.? Added some files in each of sub directories a1, a2, etc.
?indx1<- indx[indx!=""]
lapply(indx1,function(x) list.files(x))
#[[1]]
#[1] "a1.txt"??????? "mmmmm11kk.txt"
#[[2]]
#[1] "a2.txt"??????? "mmmmm11kk.txt"
#[[3]]
#[1] "a3.txt"??????? "mmmmm11kk.txt"
#[[4]]
#[1] "b1.txt"????...