[Zooimage-commits] r158 - pkg/zooimage/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed May 27 11:39:06 CEST 2009


Author: kevin
Date: 2009-05-27 11:39:06 +0200 (Wed, 27 May 2009)
New Revision: 158

Modified:
   pkg/zooimage/R/ZITrain.r
Log:
replace paste by file.path in Add.Vign function

Modified: pkg/zooimage/R/ZITrain.r
===================================================================
--- pkg/zooimage/R/ZITrain.r	2009-05-27 09:33:01 UTC (rev 157)
+++ pkg/zooimage/R/ZITrain.r	2009-05-27 09:39:06 UTC (rev 158)
@@ -306,8 +306,8 @@
   # Create the new directory
   NewDir <- "_/New_Vign_1"
   # Check if the new directory name already exists
-  if(file.exists(paste(train, NewDir, sep = "/"))){
-    Vign_lst <- dir(paste(train, "_", sep = "/"), pattern = "New_Vign_")
+  if(file.exists(file.path(train, NewDir))){
+    Vign_lst <- dir(file.path(train, "_"), pattern = "New_Vign_")
     NewDir <- paste("_/New_Vign_", (length(Vign_lst)+1), sep ="")
   }
   zmax <- length(zidfiles)
@@ -324,7 +324,7 @@
     logProcess("vignettes", zidfiles[i])
     Progress(i, zmax)
     # Unzip vignettes (*.jpg files) there
-    cmd <- paste('"', ZIpgm("unzip", "misc"), '" -jqq "', zidfiles[i], '" *.jpg -d "', paste(train, NewDir, sep = "/"), '"', sep = "")
+    cmd <- paste('"', ZIpgm("unzip", "misc"), '" -jqq "', zidfiles[i], '" *.jpg -d "', file.path(train, NewDir), '"', sep = "")
       system(cmd, show.output.on.console = TRUE, invisible = TRUE)
   }
 }



More information about the Zooimage-commits mailing list