Double the [[]] and add a + for one-or-more characters:
sub("[[:blank:]]+$", "", COLNAMES)
> On Aug 2, 2016, at 12:46 PM, Dennis Fisher wrote:
>
> R 3.3.1
> OS X
>
> Colleagues,
>
> I have encountered an unexpected regex problem
>
> I have read an Excel file into R using the readxl packa
First, use [[:blank:]] instead of [:blank:]. that latter matches colon, b,
l,
a, n, and k, the former whitespace.
Second, put + after [[:blank:]] to match one or more of them.
Bill Dunlap
TIBCO Software
wdunlap tibco.com
On Tue, Aug 2, 2016 at 9:46 AM, Dennis Fisher wrote:
> R 3.3.1
> OS X
>
>
> On Aug 2, 2016, at 11:46 AM, Dennis Fisher wrote:
>
> R 3.3.1
> OS X
>
> Colleagues,
>
> I have encountered an unexpected regex problem
>
> I have read an Excel file into R using the readxl package. Columns names are:
>
> COLNAMES <- c("Study ID", "Test and Biological Matrix", "Subj
R 3.3.1
OS X
Colleagues,
I have encountered an unexpected regex problem
I have read an Excel file into R using the readxl package. Columns names are:
COLNAMES<- c("Study ID", "Test and Biological Matrix", "Subject No. ",
"Collection Date",
"Collection Time", "Scheduled Time Point",
4 matches
Mail list logo