The R Project SVN R

Rev

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

Rev 27117 Rev 27124
Line 70... Line 70...
70
## a useful function: rev() for strings
70
## a useful function: rev() for strings
71
strReverse <- function(x)
71
strReverse <- function(x)
72
	sapply(lapply(strsplit(x, NULL), rev), paste, collapse="")
72
	sapply(lapply(strsplit(x, NULL), rev), paste, collapse="")
73
strReverse(c("abc", "Statistics"))
73
strReverse(c("abc", "Statistics"))
74
 
74
 
-
 
75
## get the first names of the members of R-core
75
a <- readLines(file.path(R.home(), "AUTHORS"))[-(1:8)]
76
a <- readLines(file.path(R.home(),"AUTHORS"))[-(1:8)]
76
a <- a[(0:2)-length(a)]
77
a <- a[(0:2)-length(a)]
77
sub("\t.*","", a) # names without e-addresses
78
(a <- sub(" .*","", a))
78
strReverse(sub(" .*","", a))# reverse the first names
79
# and reverse them
-
 
80
strReverse(a)
79
}
81
}
80
\keyword{character}
82
\keyword{character}