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
project.org]
On Behalf Of Trafim Vanishek
Sent: 14 July 2010 11:13
To: r-help@r-project.org
Subject: [R] reverse string
Dear all,
Are there any functions in R to reverse the order of the string.
smth like reverse("abc") to get "cba"?
Thanks a lot
Dear all,
Are there any functions in R to reverse the order of the string.
smth like reverse("abc") to get "cba"?
Thanks a lot.
[[alternative HTML version deleted]]
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-h
5 matches
Mail list logo