script demo
Shell script & Batch file & Visualization & Matlab
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
)
}
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
ShowCalendar
No comments:
Post a Comment