[Robast-commits] r986 - in branches/robast-1.1/pkg/RobAStRDA: R inst/AddMaterial/interpolation

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Jul 19 13:30:56 CEST 2018


Author: ruckdeschel
Date: 2018-07-19 13:30:56 +0200 (Thu, 19 Jul 2018)
New Revision: 986

Modified:
   branches/robast-1.1/pkg/RobAStRDA/R/sysdata.rda
   branches/robast-1.1/pkg/RobAStRDA/inst/AddMaterial/interpolation/interpolationscripts.R
Log:
[RobAStRDA] branch 1.1 modified interpolationscripts.R and for consistency recreated sysdata.rda

Modified: branches/robast-1.1/pkg/RobAStRDA/R/sysdata.rda
===================================================================
(Binary files differ)

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-19 11:29:35 UTC (rev 985)
+++ branches/robast-1.1/pkg/RobAStRDA/inst/AddMaterial/interpolation/interpolationscripts.R	2018-07-19 11:30:56 UTC (rev 986)
@@ -13,7 +13,7 @@
 #####
 
 oldwd <- getwd()
-.basepath <- "C:/rtest/RobASt/branches/robast-0.9/pkg"
+.basepath <- "C:/rtest/RobASt/branches/robast-1.1/pkg"
 .myFolderFrom <- file.path(.basepath,"RobExtremesBuffer")
 myRDA0 <- file.path(.basepath,"RobExtremesBuffer/sysdata.rda")
 #myRDA <- file.path(.basepath,"RobExtremesBuffer/sysdata.rda")
@@ -26,3 +26,112 @@
                withPrint = TRUE, withSmooth = TRUE, df = NULL)
 ##
 .computeInterpolators(myRDA0, myRDA,withSmoothFct = TRUE)
+###
+
+if(FALSE){
+#---------------------------------------------------------
+# (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]])))
+   }
+}
+}
+#---------------------------------------------------------
+# (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]])))
+   }
+}
+}
+#---------------------------------------------------------
+# (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)
+
+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]])))
+   }
+}
+}
+#---------------------------------------------------------
+# (4) save merged files and zip them
+#---------------------------------------------------------
+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")
+
+
+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)
+}
+
+
+}
\ No newline at end of file



More information about the Robast-commits mailing list