Revision 2687

tmp/org.txm.statsengine.r.core/src/org/txm/statsengine/r/core/data/MatrixImpl.java (revision 2687)
710 710
			REXP r = rw.eval(symbol + " <- " + symbol + "[,-" + ArrayIndex.zeroToOneBasedIndex(col) + "];"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
711 711
		}
712 712
		catch (RWorkspaceException e) {
713
			// TODO Auto-generated catch block
714
			org.txm.utils.logger.Log.printStackTrace(e);
713
			Log.printStackTrace(e);
715 714
		}
716 715
	}
717 716
	
......
732 731
			}
733 732
		}
734 733
		catch (RWorkspaceException e) {
735
			// TODO Auto-generated catch block
736
			org.txm.utils.logger.Log.printStackTrace(e);
734
			Log.printStackTrace(e);
737 735
		}
738 736
	}
739 737
	
......
753 751
	
754 752
	public void removeCols(int[] cols, boolean removeEmptyLines) throws RWorkspaceException {
755 753
		removeCols(cols);
756
		if (removeEmptyLines) removeEmptyRows();
754
		if (removeEmptyLines) {
755
			removeEmptyRows();
756
		}
757 757
	}
758 758
	
759 759
	/**
......
783 783
			ArrayList<Integer> removecols = new ArrayList<>();
784 784
			// get the empty line index
785 785
			for (int i = 0; i < colsums.length; i++) {
786
				if (colsums[i] == 0)
786
				if (colsums[i] == 0) {
787 787
					removecols.add(i);
788
				}
788 789
			}
789 790
			
790 791
			if (removecols.size() > 0) {
......
792 793
			}
793 794
		}
794 795
		catch (REXPMismatchException e) {
795
			// TODO Auto-generated catch block
796
			org.txm.utils.logger.Log.printStackTrace(e);
796
			Log.printStackTrace(e);
797 797
		}
798 798
	}
799 799
	
......
808 808
			ArrayList<Integer> rowIndexes = new ArrayList<>();
809 809
			// get the empty line index
810 810
			for (int i = 0; i < rowsums.length; i++) {
811
				if (rowsums[i] == 0)
811
				if (rowsums[i] == 0) {
812 812
					rowIndexes.add(i);
813
				}
813 814
			}
814 815
			
815 816
			if (rowIndexes.size() > 0) {
......
817 818
			}
818 819
		}
819 820
		catch (REXPMismatchException e) {
820
			// TODO Auto-generated catch block
821
			org.txm.utils.logger.Log.printStackTrace(e);
821
			Log.printStackTrace(e);
822 822
		}
823 823
	}
824 824
	
......
834 834
					+ " <- " + symbol + "[ -" + ArrayIndex.zeroToOneBasedIndex(row) + ",];"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
835 835
		}
836 836
		catch (RWorkspaceException e) {
837
			// TODO Auto-generated catch block
838
			org.txm.utils.logger.Log.printStackTrace(e);
837
			Log.printStackTrace(e);
839 838
		}
840 839
		// de la liste rows
841 840
	}
......
910 909
	
911 910
	public void removeRows(int[] rows, boolean removeEmptyCols) throws RWorkspaceException {
912 911
		removeRows(rows);
913
		if (removeEmptyCols) removeEmptyCols();
912
		if (removeEmptyCols) {
913
			removeEmptyCols();
914
		}
914 915
	}
915 916
	
916 917
	/**
......
987 988
					+ "[" + ArrayIndex.zeroToOneBasedIndex(row) + ", " + ArrayIndex.zeroToOneBasedIndex(col) + " ] <- " + value + ";"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
988 989
		}
989 990
		catch (RWorkspaceException e) {
990
			// TODO Auto-generated catch block
991
			org.txm.utils.logger.Log.printStackTrace(e);
991
			Log.printStackTrace(e);
992 992
		}
993 993
	}
994 994
	
......
1006 1006
		}
1007 1007
		String order = "c("; //$NON-NLS-1$
1008 1008
		if (reverse) {
1009
			for (int i = neworder.size() - 1; i >= 0; i--)
1009
			for (int i = neworder.size() - 1; i >= 0; i--) {
1010 1010
				order += "" + (neworder.get(i) + 1) + ", "; //$NON-NLS-1$ //$NON-NLS-2$
1011
			}
1011 1012
		}
1012 1013
		else {
1013
			for (Integer i : neworder)
1014
			for (Integer i : neworder) {
1014 1015
				order += "" + (i + 1) + ", "; //$NON-NLS-1$ //$NON-NLS-2$
1016
			}
1015 1017
		}
1016 1018
		order = order.substring(0, order.length() - 2);
1017 1019
		order += ")"; //$NON-NLS-1$
......
1021 1023
			// REXP r2 = rw.eval("rownames("+symbol+") <- rownames(" + symbol + ")[" + order + "];"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
1022 1024
		}
1023 1025
		catch (RWorkspaceException e) {
1024
			// TODO Auto-generated catch block
1025
			org.txm.utils.logger.Log.printStackTrace(e);
1026
			Log.printStackTrace(e);
1026 1027
		}
1027 1028
	}
1028 1029
	
......
1040 1041
							+ "<- " + symbol + "[order(" + symbol + "[ ," + (col + 1) + "], decreasing = " + reverse.toString().toUpperCase() + "), ];;"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
1041 1042
		}
1042 1043
		catch (RWorkspaceException e) {
1043
			// TODO Auto-generated catch block
1044
			org.txm.utils.logger.Log.printStackTrace(e);
1044
			Log.printStackTrace(e);
1045 1045
		}
1046 1046
	}
1047 1047
	
......
1060 1060
			getRowNames().sort(reverse);
1061 1061
		}
1062 1062
		catch (RWorkspaceException e) {
1063
			// TODO Auto-generated catch block
1064
			org.txm.utils.logger.Log.printStackTrace(e);
1063
			Log.printStackTrace(e);
1065 1064
		}
1066 1065
	}
1067 1066
	
......
1081 1080
							+ ", sep=\"" + colseparator + "\");"); //$NON-NLS-1$ //$NON-NLS-2$
1082 1081
		}
1083 1082
		catch (Exception e1) {
1084
			org.txm.utils.logger.Log.printStackTrace(e1);
1083
			Log.printStackTrace(e1);
1085 1084
			RWorkspace.printLastSafeEvalExpr();
1086 1085
			return false;
1087 1086
		}

Also available in: Unified diff