Displaying 1 result from an estimated 1 matches for "landscenarios".
2012 Jun 11
2
replacing values of matrix with random values of another dataframe
...D1=ifelse(m_good_initial<0,0,m_good_initial)
m_good_D1mat=matrix(m_good_D1,byrow=T,21)
m_good_D1=as.data.frame(m_good_D1mat)
#create matrix of (1000x21) that contains whole-number values ranging from
1-7
#using sample to select values with a respective probability
search_strat_good <-
sample(landscenarios,1000,replace=T,prob=com_avgpgood[1,])
for (i in 2:21) {
search_strat_good <-
cbind(search_strat_good,sample(landscenarios,1000,replace=T,prob=com_avgpgood[i,]))
}
#replace all search strategies of value "1" within matrix
"search_strat_good"
#with a random value from...