Index: tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/Property.java
===================================================================
--- tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/Property.java	(revision 1959)
+++ tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/Property.java	(revision 1960)
@@ -31,8 +31,10 @@
 import java.util.List;
 
 import org.apache.commons.lang.StringUtils;
+import org.txm.core.messages.TXMCoreMessages;
 import org.txm.core.preferences.TXMPreferences;
 import org.txm.searchengine.cqp.clientExceptions.CqiClientException;
+import org.txm.utils.logger.Log;
 
 
 /**
@@ -124,7 +126,6 @@
 		return (this.getQualifiedName().compareTo((p).getQualifiedName()));
 	}
 	
-	
 	/**
 	 * Converts the specified string to a list of Property from the specified Corpus.
 	 * @param corpus
@@ -135,7 +136,7 @@
 	public static List<? extends Property> stringToProperties(CQPCorpus corpus, String str) {
 		ArrayList<Property> properties = new ArrayList<Property>();
 		
-		if (str == null) {
+		if (str == null || corpus == null) {
 			return properties;
 		}
 
@@ -147,14 +148,13 @@
 					properties.add(p);
 				}
 			} catch (CqiClientException e) {
-				// TODO Auto-generated catch block
-				e.printStackTrace();
+				Log.warning(TXMCoreMessages.bind("** No property {0} found in the {1} corpus: {2}", s, corpus, e));
+				Log.printStackTrace(e);
 			}
 		}
 		return properties;
 	}
 
-
 	/**
 	 * Converts the specified list of Property to a string.
 	 * 
@@ -174,5 +174,4 @@
 		
 		return StringUtils.join(names, TXMPreferences.LIST_SEPARATOR);
 	}
-	
 }
Index: tmp/org.txm.statsengine.r.rcp/plugin.xml
===================================================================
--- tmp/org.txm.statsengine.r.rcp/plugin.xml	(revision 1959)
+++ tmp/org.txm.statsengine.r.rcp/plugin.xml	(revision 1960)
@@ -140,6 +140,9 @@
                   <reference
                         definitionId="OneCorpusSelected">
                   </reference>
+                  <reference
+                        definitionId="OnePartitionIndexSelected">
+                  </reference>
                </or>
             </visibleWhen>
          </command>
@@ -172,6 +175,9 @@
                   <reference
                         definitionId="OneCorpusSelected">
                   </reference>
+                  <reference
+                        definitionId="OnePartitionIndexSelected">
+                  </reference>
                </or>
             </visibleWhen>
          </command>
@@ -204,6 +210,9 @@
                   <reference
                         definitionId="OneCorpusSelected">
                   </reference>
+                  <reference
+                        definitionId="OnePartitionIndexSelected">
+                  </reference>
                </or>
             </visibleWhen>
          </command>
Index: tmp/org.txm.statsengine.r.rcp/src/org/txm/statsengine/r/rcp/handlers/SendToRCommand.java
===================================================================
--- tmp/org.txm.statsengine.r.rcp/src/org/txm/statsengine/r/rcp/handlers/SendToRCommand.java	(revision 1959)
+++ tmp/org.txm.statsengine.r.rcp/src/org/txm/statsengine/r/rcp/handlers/SendToRCommand.java	(revision 1960)
@@ -142,7 +142,6 @@
 			RTransformer<? extends TXMResult> transformer = rengine.getTransformers().get(o.getClass().getName());
 			return transformer.fromTXMtoR(o);
 		} else {
-			Log.info(NLS.bind("{0} cannot be copied in thr R workspace", o.getSimpleName()));
 			return null;
 		}
 	//TODO: MD: create the SendToRCommands commands in all plugins that manage the following TXMResult classes
Index: tmp/org.txm.progression.core/src/org/txm/progression/core/r/ProgressionRTransformer.java
===================================================================
--- tmp/org.txm.progression.core/src/org/txm/progression/core/r/ProgressionRTransformer.java	(revision 0)
+++ tmp/org.txm.progression.core/src/org/txm/progression/core/r/ProgressionRTransformer.java	(revision 1960)
@@ -0,0 +1,23 @@
+package org.txm.progression.core.r;
+
+import org.txm.core.results.TXMResult;
+import org.txm.progression.core.functions.Progression;
+import org.txm.statsengine.r.core.RTransformer;
+import org.txm.statsengine.r.core.exceptions.RWorkspaceException;
+
+public class ProgressionRTransformer extends RTransformer<Progression> {
+
+	@Override
+	public Progression fromRtoTXM(String symbol) throws RWorkspaceException {
+		return null;
+	}
+
+	@Override
+	public String fromTXMtoR(TXMResult o) throws RWorkspaceException {
+
+		if (!(o instanceof Progression)) return null;
+		
+		return null;
+	}
+
+}

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

Index: tmp/org.txm.index.core/plugin.xml
===================================================================
--- tmp/org.txm.index.core/plugin.xml	(revision 1959)
+++ tmp/org.txm.index.core/plugin.xml	(revision 1960)
@@ -11,9 +11,17 @@
       <extension
          point="org.txm.statsengine.r.core.RTransformer">
       <transfert
+            class="org.txm.index.core.r.LexiconRTransformer"
+            type="org.txm.index.core.functions.Lexicon">
+      </transfert>
+      <transfert
             class="org.txm.index.core.r.IndexRTransformer"
             type="org.txm.index.core.functions.Index">
       </transfert>
+      <transfert
+            class="org.txm.index.core.r.ParitionIndexRTransformer"
+            type="org.txm.index.core.functions.PartitionIndex">
+      </transfert>
    </extension>
 
 </plugin>
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 1959)
+++ tmp/org.txm.index.core/src/org/txm/index/core/functions/Index.java	(revision 1960)
@@ -471,11 +471,7 @@
 	 * @return the corpus
 	 */
 	public CQPCorpus getCorpus() {
-		if (this.parent instanceof CQPCorpus) {
-			return (CQPCorpus) this.parent;
-		} else {
-			return null;
-		}
+		return (CQPCorpus) this.parent;
 	}
 
 	@Override
Index: tmp/org.txm.index.core/src/org/txm/index/core/r/ParitionIndexRTransformer.java
===================================================================
--- tmp/org.txm.index.core/src/org/txm/index/core/r/ParitionIndexRTransformer.java	(revision 0)
+++ tmp/org.txm.index.core/src/org/txm/index/core/r/ParitionIndexRTransformer.java	(revision 1960)
@@ -0,0 +1,93 @@
+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.Line;
+import org.txm.index.core.functions.PartitionIndex;
+import org.txm.statsengine.r.core.RTransformer;
+import org.txm.statsengine.r.core.RWorkspace;
+import org.txm.statsengine.r.core.exceptions.RWorkspaceException;
+
+public class ParitionIndexRTransformer extends RTransformer<PartitionIndex> {
+
+	/** The novoc. */
+	protected static int novoc = 1;
+
+	/** The prefix r. */
+	protected static String prefixR = "PartitionIndex"; //$NON-NLS-1$
+
+	
+	public ParitionIndexRTransformer() {
+		// TODO Auto-generated constructor stub
+	}
+
+	@Override
+	public PartitionIndex fromRtoTXM(String symbol) {
+		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 PartitionIndex)) return null;
+		
+		PartitionIndex index = (PartitionIndex)o;
+		
+		String symbol = prefixR+novoc;
+
+		ArrayList<String> colnames = new ArrayList<String>();
+		List<String> partnames = index.getPartnames();
+		
+		colnames.add("F"); //$NON-NLS-1$
+		colnames.addAll(partnames);
+		
+		//System.out.println("cols: "+colnames);
+		List<Line> lines = index.getAllLines();
+		String[] keywords = new String[lines.size()];
+
+		int[] freq = new int[lines.size()];
+		ArrayList<int[]> partfreqs = new ArrayList<int[]>(partnames.size());
+		for (int j = 0; j < partnames.size(); j++) {
+			partfreqs.add(new int[lines.size()]);
+		}
+		
+		for (int i = 0 ; i < lines.size() ; i++) {
+			Line line = lines.get(i);
+			freq[i] = line.getFrequency(); 
+			keywords[i] = line.toString();
+			for (int j = 0; j < partnames.size(); j++) {
+				partfreqs.get(j)[i] = line.getFrequency(j);
+			}
+		}
+
+		RWorkspace rw = RWorkspace.getRWorkspaceInstance();
+		for (int j = 0; j < partnames.size(); j++) {
+			rw.addVectorToWorkspace("vocpartfreqs"+j, partfreqs.get(j)); //$NON-NLS-1$
+		}
+		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 + partnames.size();
+
+		int nrow = lines.size();
+		String partscmd = ""; //$NON-NLS-1$
+		for (int j = 0; j < partnames.size(); j++) {
+			partscmd +=", vocpartfreqs"+j; //$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/ParitionIndexRTransformer.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.index.core/src/org/txm/index/core/r/LexiconRTransformer.java
===================================================================
--- tmp/org.txm.index.core/src/org/txm/index/core/r/LexiconRTransformer.java	(revision 0)
+++ tmp/org.txm.index.core/src/org/txm/index/core/r/LexiconRTransformer.java	(revision 1960)
@@ -0,0 +1,80 @@
+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.Lexicon;
+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 LexiconRTransformer extends RTransformer<Lexicon> {
+
+	/** The novoc. */
+	protected static int novoc = 1;
+
+	/** The prefix r. */
+	protected static String prefixR = "Lexicon"; //$NON-NLS-1$
+
+	
+	public LexiconRTransformer() {
+		// TODO Auto-generated constructor stub
+	}
+
+	@Override
+	public Lexicon 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 Lexicon)) return null;
+		
+		Lexicon index = (Lexicon)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 line = lines.get(i);
+			freq[i] = line.getFrequency(); 
+			keywords[i] = line.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/LexiconRTransformer.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.concordance.core/plugin.xml
===================================================================
--- tmp/org.txm.concordance.core/plugin.xml	(revision 1959)
+++ tmp/org.txm.concordance.core/plugin.xml	(revision 1960)
@@ -7,5 +7,12 @@
             class="org.txm.concordance.core.preferences.ConcordancePreferences">
       </initializer>
    </extension>
+         <extension
+         point="org.txm.statsengine.r.core.RTransformer">
+      <transfert
+            class="org.txm.concordance.core.r.ConcordanceRTransformer"
+            type="org.txm.concordance.core.functions.Concordance">
+      </transfert>
+   </extension>
 
 </plugin>
Index: tmp/org.txm.concordance.core/src/org/txm/concordance/core/r/ConcordanceRTransformer.java
===================================================================
--- tmp/org.txm.concordance.core/src/org/txm/concordance/core/r/ConcordanceRTransformer.java	(revision 0)
+++ tmp/org.txm.concordance.core/src/org/txm/concordance/core/r/ConcordanceRTransformer.java	(revision 1960)
@@ -0,0 +1,68 @@
+package org.txm.concordance.core.r;
+
+import org.txm.concordance.core.functions.Concordance;
+import org.txm.concordance.core.functions.Line;
+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;
+
+public class ConcordanceRTransformer extends RTransformer<Concordance> {
+
+	/** The noconc. */
+	protected static int noconc = 1;
+
+	/** The prefix r. */
+	protected static String prefixR = "Concordances"; //$NON-NLS-1$
+	
+	@Override
+	public Concordance fromRtoTXM(String symbol) throws RWorkspaceException {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public String fromTXMtoR(TXMResult o) throws RWorkspaceException {
+		
+		if (!(o instanceof Concordance)) return null;
+		
+		Concordance conc = (Concordance)o;
+		
+		String symbol = prefixR+ noconc++;
+		String[] refs = new String[conc.getNLines()];
+		String[] lefts = new String[conc.getNLines()];
+		String[] keywords = new String[conc.getNLines()];
+		String[] rights = new String[conc.getNLines()];
+
+		int i = 0;
+		try {
+			for (Line line : conc.getLines(0, conc.getNLines())) {
+				refs[i] = line.getViewRef().toString();
+				lefts[i] = line.leftContextToString();
+				keywords[i] = line.keywordToString();
+				rights[i] = line.rightContextToString();
+				i++;
+			}
+		} catch (Exception e) {
+			org.txm.utils.logger.Log.printStackTrace(e);
+			return null; //$NON-NLS-1$
+		}
+
+		RWorkspace rw = RWorkspace.getRWorkspaceInstance();
+		rw.addVectorToWorkspace("concrefs", refs); //$NON-NLS-1$
+		rw.addVectorToWorkspace("conclefts", lefts); //$NON-NLS-1$
+		rw.addVectorToWorkspace("conckeywords", keywords); //$NON-NLS-1$
+		rw.addVectorToWorkspace("concrights", rights); //$NON-NLS-1$
+
+		rw.eval(symbol+ "<- matrix(data = c(concrefs, conclefts, conckeywords, concrights), nrow = "+conc.getNLines()+", ncol = 4)"); //$NON-NLS-1$ //$NON-NLS-2$
+		rw.eval("colnames("+symbol+" ) <- c('refs', 'leftcontext', 'keyword', 'rightcontext')"); //$NON-NLS-1$ //$NON-NLS-2$
+		rw.eval(symbol+ "<- list(data="+symbol //$NON-NLS-1$
+				+ ", leftcontext="+conc.getLeftContextSize() //$NON-NLS-1$
+				+ ", rightcontext="+conc.getRightContextSize() //$NON-NLS-1$
+				//+ ", query=\""+conc.query.getQueryString()+"\""
+				+ ")"); //$NON-NLS-1$
+
+		return symbol;
+	}
+
+}

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

Index: tmp/org.txm.cooccurrence.core/src/org/txm/cooccurrence/core/r/CooccurrencesRTransformer.java
===================================================================
--- tmp/org.txm.cooccurrence.core/src/org/txm/cooccurrence/core/r/CooccurrencesRTransformer.java	(revision 0)
+++ tmp/org.txm.cooccurrence.core/src/org/txm/cooccurrence/core/r/CooccurrencesRTransformer.java	(revision 1960)
@@ -0,0 +1,67 @@
+package org.txm.cooccurrence.core.r;
+
+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;
+
+public class CooccurrencesRTransformer extends RTransformer<Cooccurrence>{
+
+	/** The noconc. */
+	protected static int nocooc = 1;
+
+	/** The prefix r. */
+	protected static String prefixR = "Cooccurrences"; //$NON-NLS-1$
+	
+	@Override
+	public Cooccurrence fromRtoTXM(String symbol) throws RWorkspaceException {
+		return null;
+	}
+
+	@Override
+	public String fromTXMtoR(TXMResult o) throws RWorkspaceException {
+		
+		if (!(o instanceof Cooccurrence)) return null;
+		
+		Cooccurrence cooc = (Cooccurrence)o;
+		
+		String symbol = prefixR+nocooc;
+
+		String[] occ = new String[cooc.getLines().size()];
+		int[] freq = new int[cooc.getLines().size()];
+		int[] cofreq = new int[cooc.getLines().size()];
+		double[] score = new double[cooc.getLines().size()];
+		double[] dist = new double[cooc.getLines().size()];
+
+		int i = 0;
+		for (CLine line : cooc.getLines()) {
+			occ[i] = line.occ;
+			freq[i] = line.freq;
+			cofreq[i] = line.nbocc;
+			score[i] = line.score;
+			dist[i] = line.distmoyenne;
+			i++;
+		}
+		
+		RWorkspace rw = RWorkspace.getRWorkspaceInstance();
+		rw.addVectorToWorkspace("coococc", occ); //$NON-NLS-1$
+		rw.addVectorToWorkspace("coocfreq", freq); //$NON-NLS-1$
+		rw.addVectorToWorkspace("cooccofreq", cofreq); //$NON-NLS-1$
+		rw.addVectorToWorkspace("coocscore", score); //$NON-NLS-1$
+		rw.addVectorToWorkspace("coocmeandist", dist); //$NON-NLS-1$
+		
+		rw.eval(symbol+ "<- matrix(data = c(coocfreq, cooccofreq, coocscore, coocmeandist), nrow = "+cooc.getLines().size()+", ncol = 4)"); //$NON-NLS-1$ //$NON-NLS-2$
+		rw.eval("rownames("+symbol+" ) <- coococc"); //$NON-NLS-1$ //$NON-NLS-2$
+		rw.eval("colnames("+symbol+" ) <- c('freq', 'cofreq', 'score', 'dist')"); //$NON-NLS-1$ //$NON-NLS-2$
+		rw.eval(symbol+ "<- list(data="+symbol //$NON-NLS-1$
+				//+ ", leftcontext="+this.leftContextSize
+				//+ ", rightcontext="+this.rightContextSize
+				//+ ", query=\""+this.query.getQueryString()+"\""
+				+ ")"); //$NON-NLS-1$
+
+		nocooc++;
+		return symbol;
+	}
+}

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

Index: tmp/org.txm.cooccurrence.core/plugin.xml
===================================================================
--- tmp/org.txm.cooccurrence.core/plugin.xml	(revision 1959)
+++ tmp/org.txm.cooccurrence.core/plugin.xml	(revision 1960)
@@ -8,4 +8,12 @@
       </initializer>
    </extension>
 
+      <extension
+         point="org.txm.statsengine.r.core.RTransformer">
+      <transfert
+            class="org.txm.cooccurrence.core.r.CooccurrencesRTransformer"
+            type="org.txm.cooccurrence.core.functions.Cooccurrence">
+      </transfert>
+   </extension>
+
 </plugin>
