On Wed, Jul 14, 2010 at 6:13 AM, Trafim Vanishek wrote:
> Dear all,
>
> Are there any functions in R to reverse the order of the string.
> smth like reverse("abc") to get "cba"?
>
Suppose data.frame DF has a column for which we wish to reverse each
component. Then using the builtin month.abb try
Hi
Quick glance to strsplit help page
strReverse <- function(x) sapply(lapply(strsplit(x, NULL), rev), paste,
collapse="")
Regards
Petr
r-help-boun...@r-project.org napsal dne 14.07.2010 12:36:12:
> On Wed, 2010-07-14 at 12:13 +0200, Trafim Vanishek wrote:
> > Dear all,
> >
> > Are there a
On Wed, 2010-07-14 at 12:13 +0200, Trafim Vanishek wrote:
> Dear all,
>
> Are there any functions in R to reverse the order of the string.
> smth like reverse("abc") to get "cba"?
> paste(rev(strsplit("abc", split = "")[[1]]), collapse = "")
[1] "cba"
If your real data is a vector of strings to
Hi,
I've no idea if there is a function for doing it, but if not, the
following seems to work
a = "this is a string"
paste(rev(substring(a,1:nchar(a),1:nchar(a))),collapse="")
Martyn
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org]
On Behalf Of
4 matches
Mail list logo