3 ##args is now a list of character vectors
4 ## First check to see if arguments are passed.
5 ## Then cycle through each element of the list and evaluate the expressions.
8 print("No arguments supplied.")
9 ##supply default values
12 for(i in 1:length(args)){
13 print(paste("Processing arg ", args[[i]]));
14 eval(parse(text=args[[i]]))
23 RRCblocks <- data.frame(
24 block = gl(nRep,length(treatments)),
29 RRC <- design(treatments, RRCblocks)$Design
30 RRC <- transform(RRC, is_a_control = ifelse(RRC$treatments %in% controls, 1, 0))
31 RRC <- RRC[order(RRC$col),]
33 RCBD <- design.rcbd(treatments, r=nRep, serie=serie)$book
35 if(serie == 1){ #Use row numbers as plot names to avoid unwanted agricolae plot num pattern
36 RRC$plots <- row.names(RCBD)
38 RRC$plots <- RCBD$plots
41 #Transform to make each column (block#, row#, col#, etc) a row so perl can parse the design file line by line
42 TRRC <- unname(as.matrix(RRC))
46 basefile <- tools::file_path_sans_ext(paramfile)
47 outfile = paste(basefile, ".design", sep="");
49 write.table(TRRC, quote=F, sep='\t', row.names=FALSE)