If I understand what you¹re trying to do, then I believe this will do the
same as your little loop:
opt.fc <- fc
opt.fc[rmax < 0.1] <- fc1[rmax < 0.1]
(this is an example of vectorization, and it¹s fundamental to how R works
and the power of R)
Then to extend it, use the same method
opt.f
I try to run an if-else command line where the else argument should be the
corresponding value of the pmax command.
#
#opt.fc is the optimal forecast
#rmax is the vector of the maximized r squared from pmax-command of 2 data
sets containing r squares
#fc1 are the estimates of
2 matches
Mail list logo