Re: [R] Split

From: jim holtman <jholtman_at_gmail.com>
Date: Tue, 08 Apr 2008 19:19:32 -0400

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?

______________________________________________
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.
Received on Tue 08 Apr 2008 - 23:26:04 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 09 Apr 2008 - 00:32:15 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive