[R] Split
jim holtman
jholtman at gmail.com
Wed Apr 9 01:19:32 CEST 2008
Assuming that this data is character, then this will work: (it removes
the last period in the string)
> x <- scan('clipboard', what='')
Read 4 items
> x
[1] "1234." "2345." "3435." "4343."
> sub("\\.$", "", x)
[1] "1234" "2345" "3435" "4343"
>
On Tue, Apr 8, 2008 at 11:30 AM, Kris Ghosh <mathkris at gmail.com> wrote:
> I have data in the form of a column such as
> 1234.
> 2345.
> 3435.
> 4343.
> I want to have the data in this form ..i.e to remove the "dot" at the
> end of each number above.
> 1234
> 2345
> 3435
> 4343
>
> I am trying to use split but it is not working. Any suggestions?
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
--
Jim Holtman
Cincinnati, OH
+1 513 646 9390
What is the problem you are trying to solve?
More information about the R-help
mailing list