search for: com_avgpgood

Displaying 1 result from an estimated 1 matches for "com_avgpgood".

2012 Jun 11
2
replacing values of matrix with random values of another dataframe
...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 dataframe "m_good_D1"...