R/adjust_chamber_vol.R

Defines functions adjust_chamber_vol

adjust_chamber_vol<-function(file,name,chamber=NULL){
if(is.null(chamber)){
  message("No parameters chosen")
  return(NULL)
}
require(XML)
X<-new.env()
X$chamber_str<-paste0("_psuedovol_",chamber)
X$file<-name
X$xml<-XML::xmlParse(file)
if(!is.null(chamber)){
  node_chamber<-xpathApply(X$xml, "//ChamberVolume//text()")
  sapply(node_chamber,function(n){xmlValue(n)<-chamber})
}
X$new_asyr_name<-gsub("[.]asyr",paste0(X$chamber_str,".asyr"),X$file)
X$name_xml <- gsub("asyr", "xml", X$file)
return(X)
}
JARS3N/LiveLongAndProsper documentation built on June 21, 2020, 12:49 p.m.