[R] sub or gsub function

Tim Calkins tim.calkins at gmail.com
Tue Oct 2 00:38:26 CEST 2007


see ?toupper

On 10/2/07, Michael Sun <mam3xs at gmail.com> wrote:
> Dear list,
>
> x <- c("year","date","time","starting price","end price","max","min")
>
> how can I change all these lower-case letter to capital letter?
>
> how can I use sub or gsub function???
>
> sub("year","YEAR",x)
>  will only change one each time...
>
> Appreciate for any helps
>
> Cheers
> mam
>
>         [[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.
>


-- 
Tim Calkins
0406 753 997



More information about the R-help mailing list