[Robast-commits] r1003 - branches/robast-1.1/pkg/RobAStRDA/inst/AddMaterial/interpolation

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Jul 20 14:54:03 CEST 2018


Author: ruckdeschel
Date: 2018-07-20 14:54:03 +0200 (Fri, 20 Jul 2018)
New Revision: 1003

Modified:
   branches/robast-1.1/pkg/RobAStRDA/inst/AddMaterial/interpolation/interpolationscripts.R
Log:
[RobAStRDA] branch 1.1 slight modifs for interpolationscripts.R

Modified: branches/robast-1.1/pkg/RobAStRDA/inst/AddMaterial/interpolation/interpolationscripts.R
===================================================================
--- branches/robast-1.1/pkg/RobAStRDA/inst/AddMaterial/interpolation/interpolationscripts.R	2018-07-20 12:53:19 UTC (rev 1002)
+++ branches/robast-1.1/pkg/RobAStRDA/inst/AddMaterial/interpolation/interpolationscripts.R	2018-07-20 12:54:03 UTC (rev 1003)
@@ -32,106 +32,108 @@
 #---------------------------------------------------------
 # (1) load package in R>3.0
 #---------------------------------------------------------
-if(getRversion()>"3.0"){
-require(RobAStRDA)
-.basepath <- "C:/rtest/RobASt/branches/robast-1.1/pkg"
-.myFolderFrom <- file.path(.basepath,"RobExtremesBuffer")
-myRDAg30 <- file.path(.basepath,"RobExtremesBuffer/sysdataOnlyGridsOnlyR-3.5.1rc.rda")
-myRDAg3 <- file.path(.basepath,"RobExtremesBuffer/sysdataWithInterpOnlyR-3.5.1rc.rda")
-file.remove(myRDAg3)
-file.remove(myRDAg30)
-CSVFiles <- grep("\\.csv$", dir(.myFolderFrom), value=TRUE)
-CSVFiles <- paste(.myFolderFrom, CSVFiles, sep="/")
-RobAStRDA:::.saveGridToRda(CSVFiles, toFileRDA = myRDAg30, withMerge = FALSE,
-                           withPrint = TRUE, withSmooth = TRUE, df = NULL)
-RobAStRDA:::.computeInterpolators(myRDAg30, myRDAg3,withSmoothFct = TRUE)
-###
-nEg3 <- new.env()
-load(myRDAg3,env=nEg3)
-nEg3L <- ls(all=TRUE,env=nEg3)
-for(nam in nEg3L){
-   loc <- get(nam,env=nEg3)
-   namU <- names(loc)
-   for(nams in namU){
-       print(c(nam,nams,names(loc[[nams]])))
-   }
-}
-}
+  if(getRversion()>"3.0"){
+    require(RobAStRDA)
+    .basepath <- "C:/rtest/RobASt/branches/robast-1.1/pkg"
+    .myFolderFrom <- file.path(.basepath,"RobExtremesBuffer")
+    (myRDAg30 <- file.path(.basepath,"RobExtremesBuffer/sysdataOnlyGridsOnlyR-3.5.1rc.rda"))
+    (myRDAg3 <- file.path(.basepath,"RobExtremesBuffer/sysdataWithInterpOnlyR-3.5.1rc.rda"))
+    file.remove(myRDAg3)
+    file.remove(myRDAg30)
+    CSVFiles <- grep("\\.csv$", dir(.myFolderFrom), value=TRUE)
+    (CSVFiles <- paste(.myFolderFrom, CSVFiles, sep="/"))
+    RobAStRDA:::.saveGridToRda(CSVFiles, toFileRDA = myRDAg30, withMerge = FALSE,
+                               withPrint = TRUE, withSmooth = TRUE, df = NULL)
+    RobAStRDA:::.computeInterpolators(myRDAg30, myRDAg3,withSmoothFct = TRUE)
+    ###
+    nEg3 <- new.env()
+    load(myRDAg3,env=nEg3)
+    nEg3L <- ls(all=TRUE,env=nEg3)
+    for(nam in nEg3L){
+       loc <- get(nam,env=nEg3)
+       namU <- names(loc)
+       for(nams in namU){
+           print(c(nam,nams,names(loc[[nams]])))
+       }
+    }
+  }
 #---------------------------------------------------------
 # (2) load package in R<2.15
 #---------------------------------------------------------
-if(getRversion()<"2.16"){
-require(RobAStRDA)
-.basepath <- "C:/rtest/RobASt/branches/robast-1.1/pkg"
-.myFolderFrom <- file.path(.basepath,"RobExtremesBuffer")
-myRDAs30 <- file.path(.basepath,"RobExtremesBuffer/sysdataOnlyGridsOnlyR-2.15.1.rda")
-myRDAs3 <- file.path(.basepath,"RobExtremesBuffer/sysdataWithInterpOnlyR-2.15.1.rda")
-file.remove(myRDAs3)
-file.remove(myRDAs30)
-CSVFiles <- grep("\\.csv$", dir(.myFolderFrom), value=TRUE)
-CSVFiles <- paste(.myFolderFrom, CSVFiles, sep="/")
-RobAStRDA:::.saveGridToRda(CSVFiles, toFileRDA = myRDAs30, withMerge = FALSE,
-                           withPrint = TRUE, withSmooth = TRUE, df = NULL)
-RobAStRDA:::.computeInterpolators(myRDAs30, myRDAs3,withSmoothFct = TRUE)
-###
-nEs3 <- new.env()
-load(myRDAs3,env=nEs3)
-nEs3L <- ls(all=TRUE,env=nEs3)
-for(nam in nEs3L){
-   loc <- get(nam,env=nEs3)
-   namU <- names(loc)
-   for(nams in namU){
-       print(c(nam,nams,names(loc[[nams]])))
-   }
-}
-}
+  if(getRversion()<"2.16"){
+    require(RobAStRDA)
+    .basepath <- "C:/rtest/RobASt/branches/robast-1.1/pkg"
+    .myFolderFrom <- file.path(.basepath,"RobExtremesBuffer")
+    myRDAs30 <- file.path(.basepath,"RobExtremesBuffer/sysdataOnlyGridsOnlyR-2.15.1.rda")
+    myRDAs3 <- file.path(.basepath,"RobExtremesBuffer/sysdataWithInterpOnlyR-2.15.1.rda")
+    file.remove(myRDAs3)
+    file.remove(myRDAs30)
+    CSVFiles <- grep("\\.csv$", dir(.myFolderFrom), value=TRUE)
+    CSVFiles <- paste(.myFolderFrom, CSVFiles, sep="/")
+    RobAStRDA:::.saveGridToRda(CSVFiles, toFileRDA = myRDAs30, withMerge = FALSE,
+                               withPrint = TRUE, withSmooth = TRUE, df = NULL)
+    RobAStRDA:::.computeInterpolators(myRDAs30, myRDAs3,withSmoothFct = TRUE)
+    ###
+    nEs3 <- new.env()
+    load(myRDAs3,env=nEs3)
+    nEs3L <- ls(all=TRUE,env=nEs3)
+    for(nam in nEs3L){
+       loc <- get(nam,env=nEs3)
+       namU <- names(loc)
+       for(nams in namU){
+           print(c(nam,nams,names(loc[[nams]])))
+       }
+    }
+  }
 #---------------------------------------------------------
 # (3) back in R>3.0 merge grids
 #---------------------------------------------------------
-if(getRversion()>"3.0"){
-myRDAs30 <- file.path(.basepath,"RobExtremesBuffer/sysdataOnlyGridsOnlyR-2.15.1.rda")
-myRDAs3 <- file.path(.basepath,"RobExtremesBuffer/sysdataWithInterpOnlyR-2.15.1.rda")
-nEs3 <- new.env()
-mergeE <- new.env()
-load(myRDAs3,env=nEs3)
-(nEs3L <- ls(all=TRUE,env=nEs3))
-names(get(".Gamma", env = nEs3)$MBRE)
+  if(getRversion()>"3.0"){
+    myRDAs30 <- file.path(.basepath,"RobExtremesBuffer/sysdataOnlyGridsOnlyR-2.15.1.rda")
+    myRDAs3 <- file.path(.basepath,"RobExtremesBuffer/sysdataWithInterpOnlyR-2.15.1.rda")
+    nEs3 <- new.env()
+    mergeE <- new.env()
+    load(myRDAs3,env=nEs3)
+    (nEs3L <- ls(all=TRUE,env=nEs3))
+    names(get(".Gamma", env = nEs3)$MBRE)
 
-for(nam in nEg3L){
-   loc <- get(nam,env=nEg3)
-   namU <- names(loc)
-   for(nams in namU){
-       print(c(nam,nams,names(loc[[nams]])))
-   loc[[nams]]$fun.O <- get(nam,env=nEs3)[[nams]][["fun.O"]]
-   }
-   assign(nam,loc,env=mergeE)
-}
-(mergeEL <- ls(all=TRUE,env=mergeE))
+    for(nam in nEg3L){
+       loc <- get(nam,env=nEg3)
+       namU <- names(loc)
+       for(nams in namU){
+           print(c(nam,nams,names(loc[[nams]])))
+       loc[[nams]]$fun.O <- get(nam,env=nEs3)[[nams]][["fun.O"]]
+       }
+       assign(nam,loc,env=mergeE)
+    }
+    (mergeEL <- ls(all=TRUE,env=mergeE))
 
-for(nam in mergeEL){
-   loc <- get(nam,env=mergeE)
-   namU <- names(loc)
-   for(nams in namU){
-       print(c(nam,nams,names(loc[[nams]])))
-   }
-}
-}
+    for(nam in mergeEL){
+       loc <- get(nam,env=mergeE)
+       namU <- names(loc)
+       for(nams in namU){
+           print(c(nam,nams,names(loc[[nams]])))
+       }
+    }
+  }
 #---------------------------------------------------------
 # (4) save merged files and zip them
 #---------------------------------------------------------
-if(getRversion()>"3.0"){
+  if(getRversion()>"3.0"){
 
-myRDAmerge <- file.path(.basepath,"RobExtremesBuffer/sysdataWithInterpMerge.rda")
-myRDAmergeZip <- file.path(.basepath,"RobExtremesBuffer/sysdataWithInterpMergeZip.rda")
-myRDA <- file.path(.basepath,"RobAStRDA/R/sysdata.rda")
+    myRDAmerge <- file.path(.basepath,"RobExtremesBuffer/sysdataWithInterpMerge.rda")
+    myRDAmergeZip <- file.path(.basepath,"RobExtremesBuffer/sysdataWithInterpMergeZip.rda")
+    myRDA <- file.path(.basepath,"RobAStRDA/R/sysdata.rda")
 
 
-mergeEL <- ls(all=TRUE,env=mergeE)
-save(list=mergeEL,envir=mergeE,file=myRDAmerge)
-file.copy(from = myRDAmerge, to = myRDAmergeZip, overwrite = TRUE)
-tools::resaveRdaFiles(myRDAmergeZip)
-file.copy(from = myRDAmergeZip, to = myRDA, overwrite = TRUE)
-}
+    mergeEL <- ls(all=TRUE,env=mergeE)
+    save(list=mergeEL,envir=mergeE,file=myRDAmerge)
+    file.copy(from = myRDAmerge, to = myRDAmergeZip, overwrite = TRUE)
+    tools::resaveRdaFiles(myRDAmergeZip)
+    file.copy(from = myRDAmergeZip, to = myRDA, overwrite = TRUE)
+    }
 
-
+#---------------------------------------------------------
+# end of if(FALSE)
+#---------------------------------------------------------
 }
\ No newline at end of file



More information about the Robast-commits mailing list