R/edit_parfile_eventtime.R

Defines functions edit_parfile_eventtime

edit_parfile_eventtime<-function(templateparfilename,outparfilename,eventtime,overwrite=T){
  templateparfile<- scan(file = templateparfilename,what = 'character',sep = "\n")
  lline<-grep("1 historical event",templateparfile)
  templateparfile[lline+1]<-sub("^\\d+(.*)$","\\1",templateparfile[lline+1])
  templateparfile[lline+1]<-paste(eventtime,templateparfile[lline+1],sep='')
  sink(outparfilename)
  for(n in templateparfile){
    cat(n,"\n",sep='')
  }
  sink()
}
huatengh/CoExpansionValidation documentation built on Nov. 19, 2021, 11:07 a.m.