Code Causing RStudio Crash


I am trying to delete all dashes that appear at the end of a string and my code is causing R to crash. Any tweaks or code fixes that might not cause this would be greatly appreciated!

acct_nm = str_replace_all(acct_nm, "[:punct:]+", "")

Right not I have this wrapped as part of a mutate, unfortunately I cannot show all of my code or include my data. Basically all I want it to replace the acct_nm variable with acct_nm - any trailing punctuation.


This looks fine, you just need to add "$" at the end of your regex string to replace punctuation at the right hand end only. I can't see any reason why this would crash your session.

I started with that, but it also causes crashes. Sorry, I forgot to add it back in before posting.

It's probably not this that is crashing your session.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.