The R Project SVN R

Rev

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

Rev 84211 Rev 85535
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--2020	The R Core Team
4
 *  Copyright (C) 2000--2023	The R Core Team
5
 *  Copyright (C) 2001--2012	The R Foundation
5
 *  Copyright (C) 2001--2012	The R Foundation
6
 *
6
 *
7
 *  This program is free software; you can redistribute it and/or modify
7
 *  This program is free software; you can redistribute it and/or modify
8
 *  it under the terms of the GNU General Public License as published by
8
 *  it under the terms of the GNU General Public License as published by
9
 *  the Free Software Foundation; either version 2 of the License, or
9
 *  the Free Software Foundation; either version 2 of the License, or
Line 61... Line 61...
61
	int l = (tmp == NA_STRING) ? R_print.na_width_noquote : Rstrlen(tmp, 0);
61
	int l = (tmp == NA_STRING) ? R_print.na_width_noquote : Rstrlen(tmp, 0);
62
	Rprintf("%*s%s", w-l, "",
62
	Rprintf("%*s%s", w-l, "",
63
		EncodeString(tmp, l, 0, Rprt_adj_left));
63
		EncodeString(tmp, l, 0, Rprt_adj_left));
64
    }
64
    }
65
    else {
65
    else {
66
	Rprintf("%*s[,%ld]", w-IndexWidth(j+1)-3, "", j+1);
66
	Rprintf("%*s[,%ld]", w-IndexWidth(j+1)-3, "", (long)j+1);
67
    }
67
    }
68
}
68
}
69
 
69
 
70
static void RightMatrixColumnLabel(SEXP cl, int j, int w)
70
static void RightMatrixColumnLabel(SEXP cl, int j, int w)
71
{
71
{
Line 77... Line 77...
77
		EncodeString(tmp, l, 0, Rprt_adj_right)); */
77
		EncodeString(tmp, l, 0, Rprt_adj_right)); */
78
	Rprintf("%*s%s", R_print.gap+w-l, "",
78
	Rprintf("%*s%s", R_print.gap+w-l, "",
79
		EncodeString(tmp, l, 0, Rprt_adj_right));
79
		EncodeString(tmp, l, 0, Rprt_adj_right));
80
    }
80
    }
81
    else {
81
    else {
82
	Rprintf("%*s[,%ld]%*s", R_print.gap, "", j+1, w-IndexWidth(j+1)-3, "");
82
	Rprintf("%*s[,%ld]%*s", R_print.gap, "", (long)j+1, w-IndexWidth(j+1)-3, "");
83
    }
83
    }
84
}
84
}
85
 
85
 
86
static void LeftMatrixColumnLabel(SEXP cl, int j, int w)
86
static void LeftMatrixColumnLabel(SEXP cl, int j, int w)
87
{
87
{
Line 90... Line 90...
90
	int l = (tmp == NA_STRING) ? R_print.na_width_noquote : Rstrlen(tmp, 0);
90
	int l = (tmp == NA_STRING) ? R_print.na_width_noquote : Rstrlen(tmp, 0);
91
	Rprintf("%*s%s%*s", R_print.gap, "",
91
	Rprintf("%*s%s%*s", R_print.gap, "",
92
		EncodeString(tmp, l, 0, Rprt_adj_left), w-l, "");
92
		EncodeString(tmp, l, 0, Rprt_adj_left), w-l, "");
93
    }
93
    }
94
    else {
94
    else {
95
	Rprintf("%*s[,%ld]%*s", R_print.gap, "", j+1, w-IndexWidth(j+1)-3, "");
95
	Rprintf("%*s[,%ld]%*s", R_print.gap, "", (long)j+1, w-IndexWidth(j+1)-3, "");
96
    }
96
    }
97
}
97
}
98
 
98
 
99
static void MatrixRowLabel(SEXP rl, int i, int rlabw, int lbloff)
99
static void MatrixRowLabel(SEXP rl, int i, int rlabw, int lbloff)
100
{
100
{
Line 104... Line 104...
104
	Rprintf("\n%*s%s%*s", lbloff, "",
104
	Rprintf("\n%*s%s%*s", lbloff, "",
105
		EncodeString(tmp, l, 0, Rprt_adj_left),
105
		EncodeString(tmp, l, 0, Rprt_adj_left),
106
		rlabw-l-lbloff, "");
106
		rlabw-l-lbloff, "");
107
    }
107
    }
108
    else {
108
    else {
109
	Rprintf("\n%*s[%ld,]", rlabw-3-IndexWidth(i + 1), "", i+1);
109
	Rprintf("\n%*s[%ld,]", rlabw-3-IndexWidth(i + 1), "", (long)i+1);
110
    }
110
    }
111
}
111
}
112
 
112
 
113
 
113
 
114
 
114