I have some strings and I'd like to convert each string in a number, so I'd like to use regular expression. My strings can be one of like:
["star"]
["near-star"]
["shared"]
["near-shared"]
["complete"]
["near-complete"]
["null"]
["near-null"]
my problem is that both these statements are true:
> grepl("star", "[\"near-star\"]")
[1] TRUE
> grepl("near-star", "[\"near-star\"]")
[1] TRUE
and this applies also to the other labels... any advice on how to write the right code to match each label is much appreciated.
best regards, Simone
==."star" == "near-star"returnsFALSE.