Responsive Retina-Friendly Menu

EcoTroph Package will be update as soon as possible when we will have some new functionalities available. However actual version of the package has a bug in the read.ecopath.model, due to new column's name used in the EwE (6.5) export function.

You have to use this new function instead of actual provided by the CRAN.

----------------------------------------------------------------------------------------------------------------------------------------------------------------------

read.ecopath.model<-function (filename) 
{
    if (missing(filename)) {
        cat("filname is missing\n")
    }
    else {
        top <- xmlRoot(xmlTreeParse(filename, useInternalNodes = TRUE))
        xmlName(top)
        names(top)
        groupname <- as.vector(xmlSApply(top[["GroupName"]], 
            xmlValue))
        v <- xmlSApply(top, function(x) as.vector(xmlSApply(x, 
            xmlValue)))
        catches_tmp <- xmlSApply(top[["Catches"]], function(x) as.numeric(xmlSApply(x, 
            xmlValue)))
        catches_tmp2 <- data.frame(catches_tmp[1:v$NumFleet])[1:length(groupname), 
            ]
        names(catches_tmp2) <- paste("catch", v$FleetName[-length(v$FleetName)])
        ecopath <- data.frame(v$GroupName, as.numeric(v$TL), 
            as.numeric(v$B), as.numeric(v$PROD), as.numeric(v$accessibility), 
            as.numeric(v$OI))
        names(ecopath) <- c("group_name", "TL", "biomass", "prod", 
            "accessibility", "OI")
        if (is.null(dim(catches_tmp2))) {
            ecopath <- data.frame(ecopath, as.data.frame(catches_tmp2[1:length(rownames(ecopath))]))
            names(ecopath) <- c("group_name", "TL", "biomass", 
                "prod", "accessibility", "OI", paste("catch.", 
                  v$fleetname[-length(v$fleetname)], sep = ""))
        }
        if (!is.null(dim(catches_tmp2))) {
            ecopath <- data.frame(ecopath, as.data.frame(catches_tmp2[1:length(rownames(ecopath)), 
                ]))
        }
        return(ecopath[!(ecopath$group_name == ""), ])
    }
}


----------------------------------------------------------------------------------------------------------------------------------------------------------------------

Just Copy new function and paste it in your script to replace actual deprecated one.

Jerome Guitton