The R Project SVN R

Rev

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

Rev 33297 Rev 34294
Line 205... Line 205...
205
    case REALSXP:
205
    case REALSXP:
206
	formatReal(REAL(x), n, &w, &d, &e, nsmall);
206
	formatReal(REAL(x), n, &w, &d, &e, nsmall);
207
	if (trim) w = 0;
207
	if (trim) w = 0;
208
	PROTECT(y = allocVector(STRSXP, n));
208
	PROTECT(y = allocVector(STRSXP, n));
209
	for (i = 0; i < n; i++) {
209
	for (i = 0; i < n; i++) {
210
	    strp = EncodeReal(REAL(x)[i], w, d, e);
210
	    strp = EncodeReal(REAL(x)[i], w, d, e, OutDec);
211
	    SET_STRING_ELT(y, i, mkChar(strp));
211
	    SET_STRING_ELT(y, i, mkChar(strp));
212
	}
212
	}
213
	UNPROTECT(1);
213
	UNPROTECT(1);
214
	break;
214
	break;
215
 
215
 
216
    case CPLXSXP:
216
    case CPLXSXP:
217
	formatComplex(COMPLEX(x), n, &w, &d, &e, &wi, &di, &ei, nsmall);
217
	formatComplex(COMPLEX(x), n, &w, &d, &e, &wi, &di, &ei, nsmall);
218
	if (trim) wi = w = 0;
218
	if (trim) wi = w = 0;
219
	PROTECT(y = allocVector(STRSXP, n));
219
	PROTECT(y = allocVector(STRSXP, n));
220
	for (i = 0; i < n; i++) {
220
	for (i = 0; i < n; i++) {
221
	    strp = EncodeComplex(COMPLEX(x)[i], w, d, e, wi, di, ei);
221
	    strp = EncodeComplex(COMPLEX(x)[i], w, d, e, wi, di, ei, OutDec);
222
	    SET_STRING_ELT(y, i, mkChar(strp));
222
	    SET_STRING_ELT(y, i, mkChar(strp));
223
	}
223
	}
224
	UNPROTECT(1);
224
	UNPROTECT(1);
225
	break;
225
	break;
226
 
226