[R] grep etc.

Gabor Csardi csardi at rmki.kfki.hu
Sun Feb 10 20:24:45 CET 2008


sub("-", "--", v, fixed=TRUE)

See ?sub.

Gabor

On Sun, Feb 10, 2008 at 02:14:48PM -0500, Michael Kubovy wrote:
> Dear R-helpers,
> 
> How do I transform
> v <- c('insd-otsd', 'sppr-unsp')
> into
> c('insd--otsd', 'sppr--unsp')
> ?
> _____________________________
> Professor Michael Kubovy
> University of Virginia
> Department of Psychology
> USPS:     P.O.Box 400400    Charlottesville, VA 22904-4400
> Parcels:    Room 102        Gilmer Hall
>          McCormick Road    Charlottesville, VA 22903
> Office:    B011    +1-434-982-4729
> Lab:        B019    +1-434-982-4751
> Fax:        +1-434-982-4766
> WWW:    http://www.people.virginia.edu/~mk9y/
> 
> ______________________________________________
> 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.

-- 
Csardi Gabor <csardi at rmki.kfki.hu>    UNIL DGM



More information about the R-help mailing list