I have coding of a function in R as following:
matching_score=function(nitems, tot.score) {
nInterval <- 4*nitems+1
tot <- array(0, dim=c(nInterval,2,nGroup.all) )
minimum <- nitems
maximum <- nitems*5
tot[,1,] <- c(minimum: maximum)
for (nGcut in 1:nGroup.all)
{
... But R gave an error message as : Error in tot[, 1, ] <- c(minimum:maximum) : incorrect number of subscripts How can I solve this issue? When minimum and maximum were actual numbers, the error was not presented.
Thanks in advance for your advice.