Displaying 1 result from an estimated 1 matches for "num_rows_data".
Did you mean:
num_cols_data
2011 May 18
4
Loop stopping after 1 iteration
...t why R is handling
a loop I'm writing the way it is.
Here is the script I have written:
grid_2_series<-function(gage_handle,data_type,filename)
series_name<-paste(gage_handle,data_type,sep="_")
data_grid<-read.table(file=paste(filename,".txt",sep=""))
num_rows_data<-nrow(data_grid)-1
num_cols_data<-ncol(data_grid)-4
num_obs<-num_rows_data*num_cols_data
time_series<-matrix(nrow=0,ncol=2)
for(i in 1:length(num_obs)){
rownum<-ceiling(i/31)+1
colnum<-if(i%%31==0){
35
}else{
(i%%31)+4
}
year<-data_grid[rownum,2]
month<-data_...