The R Project SVN R

Rev

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

Rev 13465 Rev 20874
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-1998  Robert Gentleman and Ross Ihaka
3
 *  Copyright (C) 1995-1998  Robert Gentleman and Ross Ihaka
4
 *  Copyright (C) 1998-2000   The R Development Core Team.
4
 *  Copyright (C) 1998-2002   The R Development Core Team.
5
 *
5
 *
6
 *  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
7
 *  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
8
 *  the Free Software Foundation; either version 2 of the License, or
8
 *  the Free Software Foundation; either version 2 of the License, or
9
 *  (at your option) any later version.
9
 *  (at your option) any later version.
Line 222... Line 222...
222
	return rep2(s, ncopy);
222
	return rep2(s, ncopy);
223
 
223
 
224
    if ((length(ncopy) != 1))
224
    if ((length(ncopy) != 1))
225
	error("invalid number of copies in \"rep\"");
225
	error("invalid number of copies in \"rep\"");
226
 
226
 
227
    if ((nc = asInteger(ncopy)) == NA_INTEGER || nc <= 0)
227
    if ((nc = asInteger(ncopy)) == NA_INTEGER || nc < 0)/* nc = 0 ok */
228
	error("invalid number of copies in \"rep\"");
228
	error("invalid number of copies in \"rep\"");
229
 
229
 
230
    ns = length(s);
230
    ns = length(s);
231
    na = nc * ns;
231
    na = nc * ns;
232
    if (isVector(s))
232
    if (isVector(s))