Let's say that we need to arrange a Hydrograph output in such a way that we can insert that results into HEC-1 input file.
The structure of hydrograph output file is 721 (Rows) by 1 (Columns)
Inorder to input the result into HEC-1, I need to arrange in n (Rows) by 10 (Columns)
Here is the R code..
workDir <- "C:/HEC-1 Installation/HEC1EXE/"
setwd(workDir)
inData <- read.csv("100yr24hr PLR 107cs.txt", header=FALSE, sep=",", as.is=TRUE)
#Mat1 <- matrix(inData$V1, 721, 10, byrow = T)
Mat1 <- matrix(inData$V1, ncol = 10, byrow = T)
write.table(Mat1, "100yr24hr PLR 107cs Transpose.txt", sep="\t", col.names=FALSE, row.names=FALSE)
The resultant file will be
No comments:
Post a Comment