I have a problem with my code in R. For this input (and AFAIK only this input), the dimension of my array matrixForSums
is different that it's supposed to be. It's supposed to be 113, but instead, the dimensions are 112. If I print sizeForBeta
, it's 113 but if I print dim(matrixForSums)
, it's 112.
Funny thing is, if I choose any other input, it's exactly the dimension it's supposed to be. If sizeForBeta
is 130, then dim(matrixForSums)
is 130.
Can you help me identify the problem?
rowNumber<-1
startIntervalForBeta<- -0.051
stopIntervalForBeta<-0.062
movementSizeForBeta<-0.001
sizeForBeta<-0
differenceForBeta <- startIntervalForBeta
sizeForBeta<-(stopIntervalForBeta-startIntervalForBeta)/movementSizeForBeta
beta0<-array(dim=c(sizeForBeta))
my_range <- 0:(sizeForBeta)
for(i in my_range) {
beta0[i]<- differenceForBeta
differenceForBeta<- differenceForBeta+movementSizeForBeta
}
matrixForSums= array(0, dim=c(sizeForBeta))