From abad48e8fe5a730788b23eda4fea0bf84f99e751 Mon Sep 17 00:00:00 2001
From: Georges Kunstler <Georges.Kunstler@gmail.com>
Date: Thu, 12 Sep 2013 09:27:32 +1000
Subject: [PATCH] error fixed in format.function.R

---
 R/format.function.R | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/R/format.function.R b/R/format.function.R
index 6919f8c..24fbe52 100644
--- a/R/format.function.R
+++ b/R/format.function.R
@@ -443,7 +443,7 @@ if(sum(!data.BA.sp[["obs.id"]] == data[["obs.id"]]) >0) stop("competition index
    print(paste("nrow of traits data",nrow(data.traits)))
    list.temp <- list(data.tree=data,data.BA.SP=data.BA.sp,data.traits=data.traits)
    save(list.temp,file=paste("./data/process/list",name.country,ecoregion,"Rdata",sep="."))
- }else{ if(is.data.frame(data.TRY)){
+ }else{ if(is.data.frame(data.TRAITS)){
           data.traits <- fun.extract.format.sp.traits.NOT.TRY(sp=unique(data[["sp"]]),
                          Latin_name=unique(data[["sp.name"]]),
                         data=data.TRAITS,name.match.traits=name.match.traits) 
@@ -453,10 +453,9 @@ if(sum(!data.BA.sp[["obs.id"]] == data[["obs.id"]]) >0) stop("competition index
       }else{
    list.temp <- list(data.tree=data,data.BA.SP=data.BA.sp,data.traits=NA)
    saveRDS(list.temp,file=paste("./data/process/list",name.country,ecoregion,"Rdata",sep="."))
- }
-}
-}
-
+   }
+  }      
+}    
 
 #######
 #### NEED TO WRITE FUNCTION TO FORMAT DATA FOR BIG TROPICAL PLOT
-- 
GitLab