Based on the advice here: Find location of character in string, I tried this:
> gregexpr(pattern ='$',"data.frame.name$variable.name")
[[1]]
[1] 30
attr(,"match.length")
[1] 0
attr(,"useBytes")
[1] TRUE
But it didn't work; note:
> nchar("data.frame.name$variable.name")
[1] 29
How do you find the location of $
in this string?