The R Project SVN R

Rev

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

Rev 68948 Rev 76240
Line 1... Line 1...
1
% File src/library/base/man/make.unique.Rd
1
% File src/library/base/man/make.unique.Rd
2
% Part of the R package, https://www.R-project.org
2
% Part of the R package, https://www.R-project.org
3
% Copyright 1995-2008 R Core Team
3
% Copyright 1995-2019 R Core Team
4
% Distributed under GPL 2 or later
4
% Distributed under GPL 2 or later
5
 
5
 
6
\name{make.unique}
6
\name{make.unique}
7
\alias{make.unique}
7
\alias{make.unique}
8
\title{Make Character Strings Unique}
8
\title{Make Character Strings Unique}
Line 42... Line 42...
42
make.unique(c(make.unique(c("a", "a")), "a"))
42
make.unique(c(make.unique(c("a", "a")), "a"))
43
 
43
 
44
make.unique(c("a", "a", "a.2", "a"))
44
make.unique(c("a", "a", "a.2", "a"))
45
make.unique(c(make.unique(c("a", "a")), "a.2", "a"))
45
make.unique(c(make.unique(c("a", "a")), "a.2", "a"))
46
 
46
 
-
 
47
## Now show a bit where this is used :
-
 
48
trace(make.unique)
-
 
49
## Applied in data.frame() constructions:
47
rbind(data.frame(x = 1), data.frame(x = 2), data.frame(x = 3))
50
(d1 <- data.frame(x = 1, x = 2, x = 3)) # direct
48
rbind(rbind(data.frame(x = 1), data.frame(x = 2)), data.frame(x = 3))
51
 d2 <- data.frame(data.frame(x = 1, x = 2), x = 3) # pairwise
-
 
52
stopifnot(identical(d1, d2),
-
 
53
          colnames(d1) == c("x", "x.1", "x.2"))
-
 
54
untrace(make.unique)
49
}
55
}
50
\keyword{character}
56
\keyword{character}