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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Sep 3 11:59:49 CEST 2010


Author: kevin
Date: 2010-09-03 11:59:48 +0200 (Fri, 03 Sep 2010)
New Revision: 193

Modified:
   pkg/zooimage/R/zid.R
Log:
delete 'classifVign' and 'classifVign.all' from zid.R

Modified: pkg/zooimage/R/zid.R
===================================================================
--- pkg/zooimage/R/zid.R	2010-09-01 13:55:50 UTC (rev 192)
+++ pkg/zooimage/R/zid.R	2010-09-03 09:59:48 UTC (rev 193)
@@ -534,57 +534,3 @@
 		class(ZI.sample) <- c("ZI1Dat", "ZIDat", "data.frame")
 	return(ZI.sample)
 }
-
-
-
-# Functions to classify vignettes according to automatic classification
-"classifVign" <- function (zidfile, Zic, log = TRUE)
-{
-	Zid <- read.zid(zidfile)
-	# Recognition of the zid file
-	Rec <- predict(Zic, Zid)
-	Gp <- unique(Rec$Ident)
-	# Create path for new directories
-	if (!is.null(attr(Zic, "path"))) {
-		# There is a 'path' attribute associated with the classifer
-		GpDir <- file.path(dirname(zidfile), "Auto_Classification",
-			attr(Zic, "path"))
-	} else {
-		# Only create classifier without taxonomic relationship
-		GpDir <- file.path(dirname(zidfile), "Auto_Classification",
-			unique(Rec$Ident))
-	}
-	# Create directories for new groups on harddisk
-	for (i in 1 : length(GpDir)) { 
-		if (!file.exists(GpDir)[i])
-			dir.create(GpDir[i], showWarnings = TRUE, recursive = TRUE)
-	}
-	# Extract Vignettes
-	uncompress.zid(zidfile)
-	# Copy vignettes from zidfile directory to group directories
-	Rec$Vign <- make.Id(Rec)
-	for (i in 1:nrow(Rec)) {
-		From <- file.path(file.path(dirname(zidfile), noext(zidfile)),
-			paste(Rec$Vign[i], "jpg", sep = "."))
-		### TODO: check this line = last change done!
-		To <- file.path(GpDir[GpDir %in% as.character(Rec$Ident[i])],
-			paste(Rec$Vign[i], "jpg", sep = "."))
-		file.copy(from = From, to = To, overwrite = FALSE)
-		file.remove(From)
-	}
-	# Remove directory
-	unlink(file.path(dirname(zidfile), noext(zidfile)), recursive = TRUE)
-	if (log)
-		cat("Your vignettes have been exported into groups in the zid directory\n")
-}
-
-"classifVign.all" <- function (zidfiles, Zic, log = TRUE)
-{
-	for (i in 1:length(zidfiles)) {
-		classifVign(zidfile = zidfiles[i], Zic = Zic, log = FALSE)  
-		if (log)
-			cat("zid file", i, "has been extracted\n")
-	}
-	cat("Your", length(zidfiles),
-		"zid files have been exported into groups in the zid directory\n")
-}



More information about the Zooimage-commits mailing list