Index: tmp/org.txm.index.core/plugin.xml
===================================================================
--- tmp/org.txm.index.core/plugin.xml	(revision 1948)
+++ tmp/org.txm.index.core/plugin.xml	(revision 1949)
@@ -7,5 +7,12 @@
             class="org.txm.index.core.preferences.IndexPreferences">
       </initializer>
    </extension>
+   <extension
+         point="org.txm.statengine.r.core.RTransformer">
+      <transformer
+            class="org.txm.index.core.r.IndexRTransformer"
+            type="org.txm.index.core.functions.Index">
+      </transformer>
+   </extension>
 
 </plugin>
Index: tmp/org.txm.index.core/src/org/txm/index/core/r/IndexRTransformer.java
===================================================================
--- tmp/org.txm.index.core/src/org/txm/index/core/r/IndexRTransformer.java	(revision 0)
+++ tmp/org.txm.index.core/src/org/txm/index/core/r/IndexRTransformer.java	(revision 1949)
@@ -0,0 +1,81 @@
+package org.txm.index.core.r;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.txm.core.results.TXMResult;
+import org.txm.index.core.functions.Index;
+import org.txm.index.core.functions.Line;
+import org.txm.statsengine.r.core.RTransformer;
+import org.txm.statsengine.r.core.RWorkspace;
+import org.txm.statsengine.r.core.exceptions.RWorkspaceException;
+
+public class IndexRTransformer extends RTransformer<Index> {
+
+	/** The novoc. */
+	protected static int novoc = 1;
+
+	/** The prefix r. */
+	protected static String prefixR = "Index"; //$NON-NLS-1$
+
+	
+	public IndexRTransformer() {
+		// TODO Auto-generated constructor stub
+	}
+
+	@Override
+	public Index fromRtoTXM(String symbol) {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	/**
+	 * As r matrix.
+	 *
+	 * @return the string
+	 * @throws RWorkspaceException the r workspace exception
+	 */
+	@Override
+	public String fromTXMtoR(TXMResult o) throws RWorkspaceException {
+		if ((o instanceof Index)) return null;
+		
+		Index index = (Index)o;
+		
+		String symbol = prefixR+novoc;
+
+		ArrayList<String> colnames = new ArrayList<String>();
+
+		colnames.add("F"); //$NON-NLS-1$
+		
+		//System.out.println("cols: "+colnames);
+		List<Line> lines = index.getAllLines();
+		String[] keywords = new String[lines.size()];
+
+		int[] freq = new int[lines.size()];
+
+		for (int i = 0 ; i < lines.size() ; i++) 
+		{
+			Line ligne = lines.get(i);
+			freq[i] = ligne.getFrequency(); 
+			keywords[i] = ligne.toString();
+		}
+
+		RWorkspace rw = RWorkspace.getRWorkspaceInstance();
+		rw.addVectorToWorkspace("vocfreq", freq); //$NON-NLS-1$
+		rw.addVectorToWorkspace("vockeywords", keywords); //$NON-NLS-1$
+		rw.addVectorToWorkspace("voccolnames", colnames.toArray(new String[colnames.size()])); //$NON-NLS-1$
+
+		int ncol = 1;
+
+		int nrow = lines.size();
+		String partscmd = ""; //$NON-NLS-1$
+		
+		rw.eval(symbol+ "<- matrix(data = c(vocfreq"+partscmd+"), nrow = "+nrow+", ncol = "+ncol+")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+		rw.eval("colnames("+symbol+" ) <- voccolnames"); //$NON-NLS-1$ //$NON-NLS-2$
+		rw.eval("rownames("+symbol+" ) <- vockeywords"); //$NON-NLS-1$ //$NON-NLS-2$
+		rw.eval(symbol+ "<- list(data="+symbol+")"); //$NON-NLS-1$ //$NON-NLS-2$
+
+		novoc++;
+		return symbol;
+	}
+}

Property changes on: tmp/org.txm.index.core/src/org/txm/index/core/r/IndexRTransformer.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.index.core/src/org/txm/index/core/functions/PartitionIndex.java
===================================================================
--- tmp/org.txm.index.core/src/org/txm/index/core/functions/PartitionIndex.java	(revision 1948)
+++ tmp/org.txm.index.core/src/org/txm/index/core/functions/PartitionIndex.java	(revision 1949)
@@ -82,16 +82,17 @@
 
 	/** The current Fmax value. */
 	protected int Fmax = 0;
+	
 	/** The current Fmin value. */
 	protected int Fmin = 9999999;
 
 	/** The lexicon used to compute the index (if query = null || query == [] && properties.size() == 1 */
 	@Deprecated
 	protected CQPLexicon lexicon;
+	
 	@Deprecated
 	protected boolean lexiconMode = false;
 
-
 	/** The current lines. */
 	protected List<Line> lines = new ArrayList<Line>();
 	/** The current number of lines. */
Index: tmp/org.txm.index.core/src/org/txm/index/core/functions/Index.java
===================================================================
--- tmp/org.txm.index.core/src/org/txm/index/core/functions/Index.java	(revision 1948)
+++ tmp/org.txm.index.core/src/org/txm/index/core/functions/Index.java	(revision 1949)
@@ -596,7 +596,6 @@
 		return selectedLines;
 	}
 
-
 	/**
 	 * return all the lines of the index.
 	 *
@@ -624,9 +623,6 @@
 		}
 	}
 
-
-
-
 	@Override
 	public String getName() {
 		try {
@@ -912,8 +908,6 @@
 		this.setProperties(properties);
 	}
 
-
-
 	public void setParameters(CQLQuery query, List<WordProperty> props, Integer filterFmin, Integer filterFmax, Integer filterVmax, Integer nLinesPerPage) {
 		this.pQuery = query;
 		this.pProperties = props;
