Index: TXM/trunk/org.txm.partition.core/src/org/txm/partition/core/r/PartitionDimensionsRTransformer.java
===================================================================
--- TXM/trunk/org.txm.partition.core/src/org/txm/partition/core/r/PartitionDimensionsRTransformer.java	(revision 0)
+++ TXM/trunk/org.txm.partition.core/src/org/txm/partition/core/r/PartitionDimensionsRTransformer.java	(revision 3521)
@@ -0,0 +1,59 @@
+package org.txm.partition.core.r;
+
+import java.util.Arrays;
+import java.util.List;
+
+import org.txm.core.results.TXMResult;
+import org.txm.partition.core.functions.PartitionDimensions;
+import org.txm.searchengine.cqp.clientExceptions.CqiClientException;
+import org.txm.searchengine.cqp.corpus.Part;
+import org.txm.statsengine.r.core.RTransformer;
+import org.txm.statsengine.r.core.RWorkspace;
+import org.txm.statsengine.r.core.exceptions.RWorkspaceException;
+
+
+public class PartitionDimensionsRTransformer extends RTransformer<PartitionDimensions> {
+	
+	public static int nrec = 1;
+	
+	public PartitionDimensionsRTransformer() {
+		
+		// TODO Auto-generated constructor stub
+	}
+	
+	@Override
+	public PartitionDimensions fromRtoTXM(String symbol) throws RWorkspaceException {
+		
+		// TODO Auto-generated method stub
+		return null;
+	}
+	
+	@Override
+	public String fromTXMtoR(PartitionDimensions o) throws RWorkspaceException {
+		
+		RWorkspace rw = RWorkspace.getRWorkspaceInstance();
+//		System.out.println("rw="+rw);
+		List<Part> parts = o.getParts(false);
+//		System.out.println("parts="+parts);
+		int[] vector = new int[parts.size()];
+		String[] svector = new String[parts.size()];
+		for (int i = 0 ; i < parts.size() ; i++) {
+			try {
+				vector[i] = parts.get(i).getSize();
+				svector[i] = parts.get(i).getName();
+			}
+			catch (CqiClientException e) {
+				// TODO Auto-generated catch block
+				e.printStackTrace();
+			}
+		}
+//		System.out.println("vector="+Arrays.toString(vector));
+//		System.out.println("svector="+Arrays.toString(svector));
+		String s = "PartitionDimensions"+nrec;
+		rw.addVectorToWorkspace(s, vector);
+		rw.addVectorToWorkspace("names("+s+")", svector);
+		nrec++;
+		return s;
+	}
+	
+}

Property changes on: TXM/trunk/org.txm.partition.core/src/org/txm/partition/core/r/PartitionDimensionsRTransformer.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: TXM/trunk/org.txm.partition.core/plugin.xml
===================================================================
--- TXM/trunk/org.txm.partition.core/plugin.xml	(revision 3520)
+++ TXM/trunk/org.txm.partition.core/plugin.xml	(revision 3521)
@@ -28,5 +28,12 @@
             fileNamePrefix="partition_dimensions_pie">
       </ChartCreator>
    </extension>
+   <extension
+         point="org.txm.statsengine.r.core.RTransformer">
+      <transformer
+            class="org.txm.partition.core.r.PartitionDimensionsRTransformer"
+            type="org.txm.partition.core.functions.PartitionDimensions">
+      </transformer>
+   </extension>
 
 </plugin>
Index: TXM/trunk/org.txm.concordance.core/src/org/txm/concordance/core/r/ConcordanceRTransformer.java
===================================================================
--- TXM/trunk/org.txm.concordance.core/src/org/txm/concordance/core/r/ConcordanceRTransformer.java	(revision 3520)
+++ TXM/trunk/org.txm.concordance.core/src/org/txm/concordance/core/r/ConcordanceRTransformer.java	(revision 3521)
@@ -22,7 +22,7 @@
 	}
 
 	@Override
-	public String fromTXMtoR(TXMResult o) throws RWorkspaceException {
+	public String fromTXMtoR(Concordance o) throws RWorkspaceException {
 		
 		if (!(o instanceof Concordance)) return null;
 		
@@ -62,6 +62,7 @@
 				//+ ", query=\""+conc.query.getQueryString()+"\""
 				+ ")"); //$NON-NLS-1$
 
+		rw.eval("rm(concrefs, conclefts, conckeywords, concrights)");
 		return symbol;
 	}
 
Index: TXM/trunk/org.txm.specificities.rcp/plugin.xml
===================================================================
--- TXM/trunk/org.txm.specificities.rcp/plugin.xml	(revision 3520)
+++ TXM/trunk/org.txm.specificities.rcp/plugin.xml	(revision 3521)
@@ -175,7 +175,7 @@
                   ifEmpty="false"
                   operator="and">
                <instanceof
-                     value="org.txm.functions.specificities.SpecificitesResult">
+                     value="org.txm.specificities.core.functions.Specificities">
                </instanceof>
             </iterate>
          </with>
Index: TXM/trunk/org.txm.specificities.core/src/org/txm/specificities/core/functions/Specificities.java
===================================================================
--- TXM/trunk/org.txm.specificities.core/src/org/txm/specificities/core/functions/Specificities.java	(revision 3520)
+++ TXM/trunk/org.txm.specificities.core/src/org/txm/specificities/core/functions/Specificities.java	(revision 3521)
@@ -40,7 +40,6 @@
 import org.eclipse.osgi.util.NLS;
 import org.rosuda.REngine.REXP;
 import org.txm.core.messages.TXMCoreMessages;
-import org.txm.core.preferences.TBXPreferences;
 import org.txm.core.preferences.TXMPreferences;
 import org.txm.core.results.Parameter;
 import org.txm.core.results.TXMParameters;
Index: TXM/trunk/org.txm.partition.rcp/plugin.xml
===================================================================
--- TXM/trunk/org.txm.partition.rcp/plugin.xml	(revision 3520)
+++ TXM/trunk/org.txm.partition.rcp/plugin.xml	(revision 3521)
@@ -122,6 +122,19 @@
             </iterate>
          </with>
       </definition>
+      <definition
+            id="OnePartitionDimensionsSelected">
+         <with
+               variable="corporaSelection">
+            <iterate
+                  ifEmpty="false"
+                  operator="and">
+               <instanceof
+                     value="org.txm.partition.core.functions.PartitionDimensions">
+               </instanceof>
+            </iterate>
+         </with>
+      </definition>
    </extension>
 
 </plugin>
Index: TXM/trunk/org.txm.chartsengine.r.core/src/org/txm/chartsengine/r/core/RChartCreator.java
===================================================================
--- TXM/trunk/org.txm.chartsengine.r.core/src/org/txm/chartsengine/r/core/RChartCreator.java	(revision 3520)
+++ TXM/trunk/org.txm.chartsengine.r.core/src/org/txm/chartsengine/r/core/RChartCreator.java	(revision 3521)
@@ -22,6 +22,8 @@
  */
 public abstract class RChartCreator<R extends ChartResult> extends ChartCreator<RChartsEngine, R> {
 	
+	protected String symbol = null;
+	
 	/**
 	 * creates an empty file. the chart will be written after in the updateChart method
 	 */
@@ -68,9 +70,11 @@
 		return RChartsEngine.class;
 	}
 	
+	public String getSymbol() {
+		return symbol;
+	}
 	
 	
-	
 	// @Override
 	// public Object createChart(ChartResult result) {
 	// //return this.createChartFile(result);
Index: TXM/trunk/org.txm.cooccurrence.core/src/org/txm/cooccurrence/core/r/CooccurrencesRTransformer.java
===================================================================
--- TXM/trunk/org.txm.cooccurrence.core/src/org/txm/cooccurrence/core/r/CooccurrencesRTransformer.java	(revision 3520)
+++ TXM/trunk/org.txm.cooccurrence.core/src/org/txm/cooccurrence/core/r/CooccurrencesRTransformer.java	(revision 3521)
@@ -2,7 +2,6 @@
 
 import org.txm.cooccurrence.core.functions.Cooccurrence;
 import org.txm.cooccurrence.core.functions.Cooccurrence.CLine;
-import org.txm.core.results.TXMResult;
 import org.txm.statsengine.r.core.RTransformer;
 import org.txm.statsengine.r.core.RWorkspace;
 import org.txm.statsengine.r.core.exceptions.RWorkspaceException;
@@ -21,7 +20,7 @@
 	}
 
 	@Override
-	public String fromTXMtoR(TXMResult o) throws RWorkspaceException {
+	public String fromTXMtoR(Cooccurrence o) throws RWorkspaceException {
 		
 		if (!(o instanceof Cooccurrence)) return null;
 		
@@ -61,6 +60,7 @@
 				//+ ", query=\""+this.query.getQueryString()+"\""
 				+ ")"); //$NON-NLS-1$
 
+		rw.eval("rm(coocfreq, cooccofreq, coocscore, coocmeandist)");
 		nocooc++;
 		return symbol;
 	}
Index: TXM/trunk/org.txm.statsengine.r.rcp/src/org/txm/statsengine/r/rcp/handlers/SendToRCommand.java
===================================================================
--- TXM/trunk/org.txm.statsengine.r.rcp/src/org/txm/statsengine/r/rcp/handlers/SendToRCommand.java	(revision 3520)
+++ TXM/trunk/org.txm.statsengine.r.rcp/src/org/txm/statsengine/r/rcp/handlers/SendToRCommand.java	(revision 3521)
@@ -44,6 +44,7 @@
 import org.txm.rcp.utils.JobHandler;
 import org.txm.rcp.views.corpora.CorporaView;
 import org.txm.statsengine.core.StatsEnginesManager;
+import org.txm.statsengine.r.core.RResult;
 import org.txm.statsengine.r.core.RStatsEngine;
 import org.txm.statsengine.r.core.RTransformer;
 import org.txm.statsengine.r.rcp.messages.RUIMessages;
@@ -84,18 +85,20 @@
 					monitor.beginTask(RUIMessages.sendingToRWorkspaceColon + list, 100);
 					int delta = 100 / list.size();
 					for (Object o : list) {
-						if (o instanceof TXMResult) {
+						if (o instanceof RResult) {
+							Log.info(NLS.bind("''{0}'' has been copied in the ''{1}'' R variable.", ((RResult)o).toString(),  ((RResult)o).getRSymbol()));
+						} else if (o instanceof TXMResult) {
 							try {
 								monitor.subTask(RUIMessages.sendingToRWorkspaceColon + o);
 								this.acquireSemaphore();
 								String symbol = send((TXMResult) o);
 								if (symbol == null) {
-									Log.info(NLS.bind("** {0} was not transfered to the R workspace.", o));
+									Log.info(NLS.bind("** ''{0}'' was not transfered to the R workspace.", o));
 									this.releaseSemaphore();
 									return Status.CANCEL_STATUS;
 								}
 								else {
-									Log.info(NLS.bind("{0} has been copied in the ''{1}'' R variable.", o.toString(), symbol));
+									Log.info(NLS.bind("''{0}'' has been copied in the ''{1}'' R variable.", o.toString(), symbol));
 								}
 								this.releaseSemaphore();
 								
@@ -141,12 +144,16 @@
 	 * @param o the o
 	 * @throws Exception the exception
 	 */
+	@SuppressWarnings({ "rawtypes", "unchecked" })
 	public static String send(TXMResult o) throws Exception {
 		
 		RStatsEngine rengine = (RStatsEngine) StatsEnginesManager.getREngine();
 		HashMap<String, RTransformer<? extends TXMResult>> transformers = rengine.getTransformers();
 		if (transformers.containsKey(o.getClass().getName())) {
-			RTransformer<? extends TXMResult> transformer = rengine.getTransformers().get(o.getClass().getName());
+			RTransformer transformer = rengine.getTransformers().get(o.getClass().getName());
+			if (transformer == null) {
+				return null;
+			}
 			String s = transformer.fromTXMtoR(o);
 			return s;
 		}
Index: TXM/trunk/org.txm.statsengine.r.rcp/plugin.xml
===================================================================
--- TXM/trunk/org.txm.statsengine.r.rcp/plugin.xml	(revision 3520)
+++ TXM/trunk/org.txm.statsengine.r.rcp/plugin.xml	(revision 3521)
@@ -143,6 +143,27 @@
                   <reference
                         definitionId="OnePartitionIndexSelected">
                   </reference>
+                  <reference
+                        definitionId="OnePartitionSelected">
+                  </reference>
+                  <reference
+                        definitionId="OneLexicalTableSelected">
+                  </reference>
+                  <reference
+                        definitionId="OneCAHSelected">
+                  </reference>
+                  <reference
+                        definitionId="OneCASelected">
+                  </reference>
+                  <reference
+                        definitionId="OneProgressionSelected">
+                  </reference>
+                  <reference
+                        definitionId="OneSpecificitiesResultSelected">
+                  </reference>
+                  <reference
+                        definitionId="OnePartitionDimensionsSelected">
+                  </reference>
                </or>
             </visibleWhen>
          </command>
@@ -178,6 +199,27 @@
                   <reference
                         definitionId="OnePartitionIndexSelected">
                   </reference>
+                  <reference
+                        definitionId="OnePartitionSelected">
+                  </reference>
+                  <reference
+                        definitionId="OneLexicalTableSelected">
+                  </reference>
+                  <reference
+                        definitionId="OneCAHSelected">
+                  </reference>
+                  <reference
+                        definitionId="OneCASelected">
+                  </reference>
+                  <reference
+                        definitionId="OneProgressionSelected">
+                  </reference>
+                  <reference
+                        definitionId="OneSpecificitiesResultSelected">
+                  </reference>
+                  <reference
+                        definitionId="OnePartitionDimensionsSelected">
+                  </reference>
                </or>
             </visibleWhen>
          </command>
@@ -213,6 +255,27 @@
                   <reference
                         definitionId="OnePartitionIndexSelected">
                   </reference>
+                  <reference
+                        definitionId="OnePartitionSelected">
+                  </reference>
+                  <reference
+                        definitionId="OneLexicalTableSelected">
+                  </reference>
+                  <reference
+                        definitionId="OneCAHSelected">
+                  </reference>
+                  <reference
+                        definitionId="OneCASelected">
+                  </reference>
+                  <reference
+                        definitionId="OneProgressionSelected">
+                  </reference>
+                  <reference
+                        definitionId="OneSpecificitiesResultSelected">
+                  </reference>
+                  <reference
+                        definitionId="OnePartitionDimensionsSelected">
+                  </reference>
                </or>
             </visibleWhen>
          </command>
Index: TXM/trunk/org.txm.progression.core/src/org/txm/progression/core/chartsengine/r/RProgressionBaseChartCreator.java
===================================================================
--- TXM/trunk/org.txm.progression.core/src/org/txm/progression/core/chartsengine/r/RProgressionBaseChartCreator.java	(revision 3520)
+++ TXM/trunk/org.txm.progression.core/src/org/txm/progression/core/chartsengine/r/RProgressionBaseChartCreator.java	(revision 3521)
@@ -13,7 +13,6 @@
 import org.txm.progression.core.chartsengine.base.ProgressionChartCreator;
 import org.txm.progression.core.chartsengine.base.Utils;
 import org.txm.progression.core.functions.Progression;
-import org.txm.progression.core.preferences.ProgressionPreferences;
 import org.txm.statsengine.r.core.RWorkspace;
 import org.txm.statsengine.r.core.exceptions.RWorkspaceException;
 import org.txm.utils.logger.Log;
@@ -136,7 +135,9 @@
 			
 			this.getChartsEngine().plot(file, cmd, result, StringEscapeUtils.escapeJava(Utils.createProgressionChartTitle(progression, cumulative)), null);
 			
-			RWorkspace.getRWorkspaceInstance().eval(Progression.prefixR + Progression.norep + " <- list(positions=positions, names=names, xmin=" + progression.getXminCorpus() + ",xmax=" + progression //$NON-NLS-1$ //$NON-NLS-2$
+			symbol = Progression.prefixR + Progression.norep;
+			
+			RWorkspace.getRWorkspaceInstance().eval(symbol + " <- list(positions=positions, names=names, xmin=" + progression.getXminCorpus() + ",xmax=" + progression //$NON-NLS-1$ //$NON-NLS-2$
 					.getXmaxCorpus() + ", structpositions=structurepositions, structnames=structurenames)");  //$NON-NLS-1$
 			Progression.norep++;
 		}
Index: TXM/trunk/org.txm.progression.core/src/org/txm/progression/core/chartsengine/r/RProgressionDensityChartCreator.java
===================================================================
--- TXM/trunk/org.txm.progression.core/src/org/txm/progression/core/chartsengine/r/RProgressionDensityChartCreator.java	(revision 3520)
+++ TXM/trunk/org.txm.progression.core/src/org/txm/progression/core/chartsengine/r/RProgressionDensityChartCreator.java	(revision 3521)
@@ -18,5 +18,4 @@
 		return super.createChart(result, file, false);
 	}
 	
-	
 }
Index: TXM/trunk/org.txm.progression.core/src/org/txm/progression/core/r/ProgressionRTransformer.java
===================================================================
--- TXM/trunk/org.txm.progression.core/src/org/txm/progression/core/r/ProgressionRTransformer.java	(revision 3520)
+++ TXM/trunk/org.txm.progression.core/src/org/txm/progression/core/r/ProgressionRTransformer.java	(revision 3521)
@@ -1,23 +1,58 @@
 package org.txm.progression.core.r;
 
-import org.txm.core.results.TXMResult;
+import java.util.List;
+
+import org.txm.progression.core.chartsengine.r.RProgressionBaseChartCreator;
 import org.txm.progression.core.functions.Progression;
+import org.txm.searchengine.core.Query;
 import org.txm.statsengine.r.core.RTransformer;
+import org.txm.statsengine.r.core.RWorkspace;
 import org.txm.statsengine.r.core.exceptions.RWorkspaceException;
 
 public class ProgressionRTransformer extends RTransformer<Progression> {
 
+	/** The prefix r. */
+	public static String prefixR = "Progression"; //$NON-NLS-1$
+	
 	@Override
 	public Progression fromRtoTXM(String symbol) throws RWorkspaceException {
 		return null;
 	}
 
 	@Override
-	public String fromTXMtoR(TXMResult o) throws RWorkspaceException {
+	public String fromTXMtoR(Progression o) throws RWorkspaceException {
 
 		if (!(o instanceof Progression)) return null;
+			
+		if (o.getChartCreator() instanceof RProgressionBaseChartCreator) {
+			return ((RProgressionBaseChartCreator)o.getChartCreator()).getSymbol();
+		} else {
+			String s = Progression.prefixR + Progression.norep;
+			Progression.norep++;
+			
+			RWorkspace rw = RWorkspace.getRWorkspaceInstance();
+			
+			List<Query> queries = o.getQueries();
+			List<int[]> positions = o.getAllPositions();
+			
+			String[] names = new String[queries.size()];
+			for (int i = 0 ; i < queries.size() ; i++) {
+				names[i] = queries.get(i).getQueryString();
+			}
+			
+			rw.addVectorToWorkspace("tmpqueries", names);
+			rw.eval("tmppositions <- list();");
+			//rw.eval(s+"$positions <- list();");
+			for (int i = 0 ; i < queries.size() ; i++) {
+				rw.addVectorToWorkspace("TEMP", positions.get(i));
+				rw.eval("tmppositions[["+(i+1)+"]] <- TEMP");
+			}
+			rw.eval(s+" <- list(queries=tmpqueries, positions=tmppositions);");
+			rw.eval("rm(tmpqueries, tmppositions);");
+			//rw.addVectorToWorkspace(variableName, vector);
+			return s;
+		}
 		
-		return null;
 	}
 
 }
Index: TXM/trunk/org.txm.progression.core/plugin.xml
===================================================================
--- TXM/trunk/org.txm.progression.core/plugin.xml	(revision 3520)
+++ TXM/trunk/org.txm.progression.core/plugin.xml	(revision 3521)
@@ -24,5 +24,12 @@
             class="org.txm.progression.core.preferences.ProgressionPreferences">
       </initializer>
    </extension>
+   <extension
+         point="org.txm.statsengine.r.core.RTransformer">
+      <transformer
+            class="org.txm.progression.core.r.ProgressionRTransformer"
+            type="org.txm.progression.core.functions.Progression">
+      </transformer>
+   </extension>
 
 </plugin>
Index: TXM/trunk/org.txm.statsengine.r.core/src/org/txm/statsengine/r/core/RTransformer.java
===================================================================
--- TXM/trunk/org.txm.statsengine.r.core/src/org/txm/statsengine/r/core/RTransformer.java	(revision 3520)
+++ TXM/trunk/org.txm.statsengine.r.core/src/org/txm/statsengine/r/core/RTransformer.java	(revision 3521)
@@ -28,5 +28,5 @@
 	 * @return the created R variable symbol
 	 * @throws RWorkspaceException
 	 */
-	public abstract String fromTXMtoR(TXMResult o) throws RWorkspaceException;
+	public abstract String fromTXMtoR(T o) throws RWorkspaceException;
 }
Index: TXM/trunk/org.txm.index.core/src/org/txm/index/core/r/ParitionIndexRTransformer.java
===================================================================
--- TXM/trunk/org.txm.index.core/src/org/txm/index/core/r/ParitionIndexRTransformer.java	(revision 3520)
+++ TXM/trunk/org.txm.index.core/src/org/txm/index/core/r/ParitionIndexRTransformer.java	(revision 3521)
@@ -35,7 +35,7 @@
 	 * @throws RWorkspaceException the r workspace exception
 	 */
 	@Override
-	public String fromTXMtoR(TXMResult o) throws RWorkspaceException {
+	public String fromTXMtoR(PartitionIndex o) throws RWorkspaceException {
 		if (!(o instanceof PartitionIndex)) return null;
 		
 		PartitionIndex index = (PartitionIndex) o;
Index: TXM/trunk/org.txm.index.core/src/org/txm/index/core/r/LexiconRTransformer.java
===================================================================
--- TXM/trunk/org.txm.index.core/src/org/txm/index/core/r/LexiconRTransformer.java	(revision 3520)
+++ TXM/trunk/org.txm.index.core/src/org/txm/index/core/r/LexiconRTransformer.java	(revision 3521)
@@ -36,7 +36,7 @@
 	 * @throws RWorkspaceException the r workspace exception
 	 */
 	@Override
-	public String fromTXMtoR(TXMResult o) throws RWorkspaceException {
+	public String fromTXMtoR(Lexicon o) throws RWorkspaceException {
 		if (!(o instanceof Lexicon)) return null;
 		
 		Lexicon index = (Lexicon) o;
@@ -74,6 +74,8 @@
 		rw.eval("rownames(" + symbol + " ) <- vockeywords"); //$NON-NLS-1$ //$NON-NLS-2$
 		rw.eval(symbol + "<- list(data=" + symbol + ")"); //$NON-NLS-1$ //$NON-NLS-2$
 		
+		rw.eval("rm(vocfreq, vockeywords, voccolnames)");
+		
 		novoc++;
 		return symbol;
 	}
Index: TXM/trunk/org.txm.index.core/src/org/txm/index/core/r/IndexRTransformer.java
===================================================================
--- TXM/trunk/org.txm.index.core/src/org/txm/index/core/r/IndexRTransformer.java	(revision 3520)
+++ TXM/trunk/org.txm.index.core/src/org/txm/index/core/r/IndexRTransformer.java	(revision 3521)
@@ -36,7 +36,7 @@
 	 * @throws RWorkspaceException the r workspace exception
 	 */
 	@Override
-	public String fromTXMtoR(TXMResult o) throws RWorkspaceException {
+	public String fromTXMtoR(Index o) throws RWorkspaceException {
 		if (!(o instanceof Index)) return null;
 		
 		Index index = (Index) o;
@@ -74,6 +74,7 @@
 		rw.eval("rownames(" + symbol + " ) <- vockeywords"); //$NON-NLS-1$ //$NON-NLS-2$
 		rw.eval(symbol + "<- list(data=" + symbol + ")"); //$NON-NLS-1$ //$NON-NLS-2$
 		
+		rw.eval("rm(vocfreq, vockeywords, voccolnames)");
 		novoc++;
 		return symbol;
 	}
