R代码里有一个命令出错 不知道什么原因 请各位大神帮忙解答一下。
code是:
>num_low <- read.csv("D:/data/regime_low.csv",header=F)
>Smatrix_low <- array(0,dim=c(lag_aic,nc,nrow(num_low)))
>for (i in (1:nrow(num_low))) {
Smatrix_low[,,i]=data[(num_low[i,]-lag_aic):(num_low[i,]-1),]
}
R 反馈的错误是:
Error in (num_low[i, ] - lag_aic):(num_low[i, ] - 1) : NA/NaN参数
此外: Warning messages:
1: In (num_low[i, ] - lag_aic):(num_low[i, ] - 1) :
numerical expression has 4 elements: only the first used
2: In (num_low[i, ] - lag_aic):(num_low[i, ] - 1) :
numerical expression has 4 elements: only the first used