Loop in R: how to save the outputs?

前端 未结 2 1349
[愿得一人]
[愿得一人] 2020-12-09 22:01

I am trying to save the data from a loop of logical tests.

So I have the following data:

T1 <- matrix(seq(from=100000, to=6600000,length.out=676),         


        
2条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-09 22:46

    Store each boolean matrix as an item in a list:

    result <- vector("list",49)
    for (i in 1:49)
    {
       result[[i]] <- T1>F[i] # I used print to see the results in the screen
    }
    
    #Print the first matrix on screen
    result[[1]]
    

提交回复
热议问题