[Sciviews-commits] r112 - pkg/svTools/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Feb 12 14:53:29 CET 2009


Author: romain
Date: 2009-02-12 14:53:29 +0100 (Thu, 12 Feb 2009)
New Revision: 112

Modified:
   pkg/svTools/R/sidekick.R
Log:
use the start column and stop column if length of srcref is 6

Modified: pkg/svTools/R/sidekick.R
===================================================================
--- pkg/svTools/R/sidekick.R	2009-02-12 11:09:15 UTC (rev 111)
+++ pkg/svTools/R/sidekick.R	2009-02-12 13:53:29 UTC (rev 112)
@@ -75,7 +75,10 @@
 	hasAttrs <- "srcref" %in% names(atts)
 	ids <- maxId + 1:length(p)
 	if( hasAttrs ){
-		srcrefs <- t( sapply( attr(p, "srcref"), function( y ) as.integer(y)[1:4] ) )  
+	  srcrefs <- t( sapply( attr(p, "srcref"), function( y ) {
+			positions <- as.integer(y)
+			if( length(positions) == 4 ) positions else positions[ c(1,5,3,6) ]
+	  } ) )  
 		colnames( srcrefs ) <- paste("srcref", 1:4 , sep = "")
 		srcrefs <- as.data.frame( srcrefs ) 
 		modes <- sapply( p, mode )



More information about the Sciviews-commits mailing list