script demo
Shell script & Batch file & Visualization & Matlab
Showing posts with label
trim
.
Show all posts
Showing posts with label
trim
.
Show all posts
Friday, December 17, 2010
Trim a string in R
# sub-functions
# Copyright:
http://scriptdemo.blogspot.com
mytrim
<-
function
(
oristr
)
{
oristr
<-
sub
(
"^ +"
,
""
,
oristr
)
oristr
<-
sub
(
" +$"
,
""
,
oristr
)
# or gsub("(^ +)|( +$)","",oristr)
return
(
oristr
)
}
Older Posts
Home
Subscribe to:
Posts (Atom)
ShowCalendar