Stuttgart_April_19_2017.R

#' Stuttgart 05 April 2017
#' @author Nha Vo-Thanh
#' reading data from text files
#'
rm(list = ls())
setwd(
  "D:/user/vthanh/Google Drive/Project Stuttgart/R_programing/UpdateFormular/Block3AugDesigns/"
)
#Sys.setenv(JAVA_HOME='C:\\Program Files\\Java\\jre1.8.0_121')
#install.packages("rJava")
library("rJava")
library(xlsx)

library(devtools)
library(roxygen2)
library(MASS)
devtools::load_all()

#-------------------------------------#
source("D:/user/vthanh/Google Drive/Project Stuttgart/R_programing/A_Eff_RowColumnDesign.r")
source("D:/user/vthanh/Google Drive/Project Stuttgart/R_programing/A_Eff_BlockDesign.r")
nTreatments <- 39
nChecks     <- 3
nRows       <- 6
nCols       <- 9
repli       <- -1
flag        <- 0
vrepChecks  <- c(6,6,6)

#--------------------------------------------------------#

nTrts       <- 2
repliz      <- rep(1, nTrts)
repliz[1]    <- 18
repliz[2]    <- 36

#--------------------------------------------------------#
pDesign   <- StartDesign(nTrts, nChecks, nRows, nCols, repliz)
for(i in 1:nRows){
  indexx <- sample(1:nCols, nCols, replace = F)
  pDesign[i,] <-pDesign[i,indexx]
}
t         <- aRCDesign(pDesign, nTrts, nRows, nCols, repliz, ncheck=1, flag=0, cRandom = 1)

#---------------------------------------------------------#
while(t<=0){
  vecchecks <- sample(4:39, 36, replace = F)
  nDesign   <- pDesign
  nDesign[which(nDesign==2)] <- vecchecks
  #-----#
  repchecks  <- sort(rep(c(1,2,3),6))
  indexx     <- sample(1:18, 18, replace = F)
  repchecks  <- repchecks[indexx]
  nDesign[which(nDesign==1)] <- repchecks
  t         <- aRCDesign(nDesign, nTreatments, nRows, nCols, repliz, ncheck=3, flag=0, cRandom = 1)
}
nhavt/Block3AugDesigns documentation built on May 7, 2019, 11:15 a.m.