ropensci / nlrx

nlrx NetLogo R
https://docs.ropensci.org/nlrx
GNU General Public License v3.0
77 stars 12 forks source link

error defining variables as strings #76

Closed m4x74 closed 1 year ago

m4x74 commented 1 year ago

I had issues defining variables as strings. According to the documentation (https://docs.ropensci.org/nlrx/articles/furthernotes.html), they need to be placed within escaped quotes (e.g. "\"string\""). This led to an "unexpected symbol"-error. Using "\"string\"" instead worked out for me.

nldoc commented 1 year ago

Actually, I cannot reproduce this issue. On MacOS RStudio, Windows RStudio and RStudio Server I am using the backslash escaped quotes "string_variable" = "\"string_variable_value\"" without any problems. It may still be that under specific circumstances (os, system configuration, encoding, etc.) the default approach of escaping quotes does not work as intended. Great that you could find a solution that works for you!

m4x74 commented 1 year ago

Sorry for the confusion, I did not check how my previous post got rendered. And this is probably the reason for the confusion about the documentation. As you said (and also I tried to write in my previous post) "string_variable" = "\"string_variable_value\"" works fine. According to the documentation (https://docs.ropensci.org/nlrx/articles/furthernotes.html, bullet point 2 underneath table), strings must be enclosed in double backslash quotes ("\\"string\\"") which does not work for me.

nldoc commented 1 year ago

Thanks for your clarification! You are completely right, this is not pointed out correctly in the documentation. It should be only one backslash ("\"string\""). I will correct it with the next update :)