Revision 2036

tmp/org.txm.statsengine.r.core/src/org/txm/statsengine/r/core/data/MatrixImpl.java (revision 2036)
284 284
		// de la liste rows
285 285
	}
286 286

  
287
	/**
288
	 * Cut.
289
	 *
290
	 * @param nRowToCut the nlines
291
	 * @throws StatException 
292
	 */
293
	public void cut(int nRowToCut){
294
		if (nRowToCut > this.getNRows())
295
			return;
296 287

  
297
		try {
298
			// cut nlines
299
			REXP r = rw.eval(symbol
300
					+ "<- " + symbol + "[1:" + (nRowToCut) + ", ];"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
301
			getRowNames().cut(nRowToCut);
302
			//this.nrow = nlines;
303
		} catch (RWorkspaceException e) {
304
			// TODO Auto-generated catch block
305
			org.txm.utils.logger.Log.printStackTrace(e);
306
		}
307
	}
308 288

  
309
	// public String[] rownames() throws RWorkspaceException {
310
	// return rw.evalToString("rownames(" + symbol + ");");
311
	// }
312

  
313 289
	/**
314 290
	 * Export data.
315 291
	 *
......
364 340
		cut(Math.min(nlines, ifmin));
365 341
	}
366 342

  
343
	/**
344
	 * Cut.
345
	 *
346
	 * @param nRowToCut the nlines
347
	 * @throws StatException 
348
	 */
349
	public void cut(int nRowToCut){
350
		if (nRowToCut > this.getNRows())
351
			return;
352

  
353
		try {
354
			// cut nlines
355
			REXP r = rw.eval(symbol + "<- " + symbol + "[1:" + (nRowToCut) + ", ];"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
356
			getRowNames().cut(nRowToCut);
357
			//this.nrow = nlines;
358
		} catch (RWorkspaceException e) {
359
			// TODO Auto-generated catch block
360
			org.txm.utils.logger.Log.printStackTrace(e);
361
		}
362
	}
363
	
367 364
	public void sortByFreqs(boolean reverse) throws RWorkspaceException, REXPMismatchException {
368 365
		rw.eval("freqs <- rowSums("+symbol+")"); //$NON-NLS-1$ //$NON-NLS-2$
369 366
		String DECREASING = "FALSE"; //$NON-NLS-1$

Also available in: Unified diff