The R Project SVN R

Rev

Rev 7701 | Rev 10172 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 7701 Rev 8552
Line 1... Line 1...
1
/*
1
/*
2
 *  R : A Computer Language for Statistical Data Analysis
2
 *  R : A Computer Language for Statistical Data Analysis
3
 *  Copyright (C) 1995, 1996  Robert Gentleman and Ross Ihaka
3
 *  Copyright (C) 1995, 1996	Robert Gentleman and Ross Ihaka
-
 
4
 *  Copyright (C) 2000		The R Development Core Team.
4
 *
5
 *
5
 *  This program is free software; you can redistribute it and/or modify
6
 *  This program is free software; you can redistribute it and/or modify
6
 *  it under the terms of the GNU General Public License as published by
7
 *  it under the terms of the GNU General Public License as published by
7
 *  the Free Software Foundation; either version 2 of the License, or
8
 *  the Free Software Foundation; either version 2 of the License, or
8
 *  (at your option) any later version.
9
 *  (at your option) any later version.
Line 51... Line 52...
51
    else
52
    else
52
	rlabw = IndexWidth(r + 1) + 3;
53
	rlabw = IndexWidth(r + 1) + 3;
53
 
54
 
54
    if (rn) {
55
    if (rn) {
55
	rnw = strlen(rn);
56
	rnw = strlen(rn);
56
	if ( rnw < rlabw + MIN_LBLOFF )
57
	if ( rnw < rlabw + R_MIN_LBLOFF )
57
	    lbloff = MIN_LBLOFF;
58
	    lbloff = R_MIN_LBLOFF;
58
	else
59
	else
59
	    lbloff = rnw - rlabw;
60
	    lbloff = rnw - rlabw;
60
 
61
 
61
	rlabw += lbloff;
62
	rlabw += lbloff;
62
    }
63
    }
Line 119... Line 120...
119
    else
120
    else
120
	rlabw = IndexWidth(r + 1) + 3;
121
	rlabw = IndexWidth(r + 1) + 3;
121
 
122
 
122
    if (rn) {
123
    if (rn) {
123
	rnw = strlen(rn);
124
	rnw = strlen(rn);
124
	if ( rnw < rlabw + MIN_LBLOFF )
125
	if ( rnw < rlabw + R_MIN_LBLOFF )
125
	    lbloff = MIN_LBLOFF;
126
	    lbloff = R_MIN_LBLOFF;
126
	else
127
	else
127
	    lbloff = rnw - rlabw;
128
	    lbloff = rnw - rlabw;
128
 
129
 
129
	rlabw += lbloff;
130
	rlabw += lbloff;
130
    }
131
    }
Line 187... Line 188...
187
    else
188
    else
188
	rlabw = IndexWidth(r + 1) + 3;
189
	rlabw = IndexWidth(r + 1) + 3;
189
 
190
 
190
    if (rn) {
191
    if (rn) {
191
	rnw = strlen(rn);
192
	rnw = strlen(rn);
192
	if ( rnw < rlabw + MIN_LBLOFF )
193
	if ( rnw < rlabw + R_MIN_LBLOFF )
193
	    lbloff = MIN_LBLOFF;
194
	    lbloff = R_MIN_LBLOFF;
194
	else
195
	else
195
	    lbloff = rnw - rlabw;
196
	    lbloff = rnw - rlabw;
196
 
197
 
197
	rlabw += lbloff;
198
	rlabw += lbloff;
198
    }
199
    }
Line 261... Line 262...
261
    else
262
    else
262
	rlabw = IndexWidth(r + 1) + 3;
263
	rlabw = IndexWidth(r + 1) + 3;
263
 
264
 
264
    if (rn) {
265
    if (rn) {
265
	rnw = strlen(rn);
266
	rnw = strlen(rn);
266
	if ( rnw < rlabw + MIN_LBLOFF )
267
	if ( rnw < rlabw + R_MIN_LBLOFF )
267
	    lbloff = MIN_LBLOFF;
268
	    lbloff = R_MIN_LBLOFF;
268
	else
269
	else
269
	    lbloff = rnw - rlabw;
270
	    lbloff = rnw - rlabw;
270
 
271
 
271
	rlabw += lbloff;
272
	rlabw += lbloff;
272
    }
273
    }
Line 289... Line 290...
289
    w = INTEGER(sw);
290
    w = INTEGER(sw);
290
 
291
 
291
    /* Determine the column widths */
292
    /* Determine the column widths */
292
 
293
 
293
    for (j = 0; j < c; j++) {
294
    for (j = 0; j < c; j++) {
294
	formatComplex(&x[j * r], r, 
295
	formatComplex(&x[j * r], r,
295
		      &wr[j], &dr[j], &er[j],
296
		      &wr[j], &dr[j], &er[j],
296
		      &wi[j], &di[j], &ei[j]);
297
		      &wi[j], &di[j], &ei[j]);
297
	if (!isNull(cl))
298
	if (!isNull(cl))
298
	    clabw = strlen(CHAR(STRING(cl)[j]));
299
	    clabw = strlen(CHAR(STRING(cl)[j]));
299
	else
300
	else
Line 328... Line 329...
328
	    MatrixRowLabel(rl, i, rlabw, lbloff);
329
	    MatrixRowLabel(rl, i, rlabw, lbloff);
329
	    for (j = jmin; j < jmax; j++) {
330
	    for (j = jmin; j < jmax; j++) {
330
		if (ISNA(x[i + j * r].r) || ISNA(x[i + j * r].i))
331
		if (ISNA(x[i + j * r].r) || ISNA(x[i + j * r].i))
331
		    Rprintf("%s", EncodeReal(NA_REAL, w[j], 0, 0));
332
		    Rprintf("%s", EncodeReal(NA_REAL, w[j], 0, 0));
332
		else
333
		else
333
		    Rprintf("%s", 
334
		    Rprintf("%s",
334
			    EncodeComplex(x[i + j * r],
335
			    EncodeComplex(x[i + j * r],
335
					  wr[j] + R_print.gap, dr[j], er[j],
336
					  wr[j] + R_print.gap, dr[j], er[j],
336
					  wi[j], di[j], ei[j]));
337
					  wi[j], di[j], ei[j]));
337
	    }
338
	    }
338
	}
339
	}
Line 356... Line 357...
356
    else
357
    else
357
	rlabw = IndexWidth(r + 1) + 3;
358
	rlabw = IndexWidth(r + 1) + 3;
358
 
359
 
359
    if (rn) {
360
    if (rn) {
360
	rnw = strlen(rn);
361
	rnw = strlen(rn);
361
	if ( rnw < rlabw + MIN_LBLOFF )
362
	if ( rnw < rlabw + R_MIN_LBLOFF )
362
	    lbloff = MIN_LBLOFF;
363
	    lbloff = R_MIN_LBLOFF;
363
	else
364
	else
364
	    lbloff = rnw - rlabw;
365
	    lbloff = rnw - rlabw;
365
 
366
 
366
	rlabw += lbloff;
367
	rlabw += lbloff;
367
    }
368
    }