fix the EPC bug, now the path is absolut

This commit is contained in:
hollorol 2018-03-04 10:04:41 +01:00
parent 47cb43fb46
commit 900e97397d
4 changed files with 11 additions and 3 deletions

View File

@ -1,6 +1,6 @@
Package: RBBGCMuso
Title: An R package for BiomeBGC-MuSo ecosystem modelling
Version: 0.3.2.0-0
Version: 0.3.3.0-0
Authors@R: person("Roland", "Hollo's", , "hollorol@gmail.com", role = c("aut", "cre"))
Description: What the package does (one paragraph).
Depends: R (>= 2.10)

View File

@ -126,6 +126,9 @@ corrigMuso <- function(settings, data){
#' @usage file.path2(str1, str2)
file.path2<-function(str1, str2){
if(str1==""|str1=="./"){
return(str2)
}
str1<-file.path(dirname(str1),basename(str1))
if(substring(str2,1,1)=="/"){
return(paste(str1,str2,sep=""))

View File

@ -55,6 +55,11 @@ setupMuso <- function(executable=NULL,
Linuxp <-(Sys.info()[1]=="Linux")
inputParser <- function(string,fileName,counter,value=TRUE){
unlist(strsplit(grep(string,fileName,value=TRUE),"[\ \t]"))[counter]
}
if(is.null(inputloc)){
inputloc<- "./"
} else {
@ -93,8 +98,8 @@ setupMuso <- function(executable=NULL,
if(is.null(epcinput)){
epcflag=TRUE
epcinput[1] <- unlist(strsplit(grep(" EPC file name",inifiles[[1]],value=TRUE),"[\ \t]"))[1]
epcinput[2] <- unlist(strsplit(grep(" EPC file name",inifiles[[2]],value=TRUE),"[\ \t]"))[1]
epcinput[1] <- paste0(inputloc,inputParser(string=" EPC file name",fileName=inifiles[[1]],counter=1,value=TRUE))
epcinput[2] <- paste0(inputloc,inputParser(string=" EPC file name",fileName=inifiles[[2]],counter=1,value=TRUE))
} else {
inifiles[[1]][grep(" EPC file name",inifiles[[1]])]<-paste(epcinput[1],"\t EPC file name",sep="")