1
> str = "a$b$c"
> astr <- strsplit(str,"$")
> astr
[[1]]
[1] "a$b$c"

Still trying to figure the answer out!

David Arenburg
  • 91,361
  • 17
  • 137
  • 196
khanna
  • 718
  • 10
  • 24

2 Answers2

1

You need to escape it

strsplit(str,"\\$")
Michele
  • 8,563
  • 6
  • 45
  • 72
1

Another option is to use , fixed = TRUE option:

strsplit(str,"$",fixed=TRUE) 
## [1] "a" "b" "c"
agstudy
  • 119,832
  • 17
  • 199
  • 261