Displaying 1 result from an estimated 1 matches for "price_rand".
Did you mean:
price_band
2011 Sep 10
2
Error : subscript out of bounds
m<-matrix(byrow=FALSE)
t<-as.list(na.exclude(x))
j<-0
o<-0
for(i in 1:998)
{
d<- 5*(i-1)+3
if(t[[d]][[1]]>80)
{
j<-j+1
e[j]<-d
l<-length(t[[d]])
u<-t[[d]]
price_rand<-t[[d-1]]
n<-0
for(k in 1:l)
{
if((u[k]>49)&&(u[k]<51))
{
n<-n+1
m[n,j]<-price_rand[k]
}
}
}
}
I am getting error in assigning the values to a matrix.
*Error in m[n, j] <- price_rand[k] : subscript out of bounds*
*
*
How to correct this ?
Please suggest me the co...