your string opens with single quote ', and has a single quote ' in the middle. R sees that as the end of the string. You will need to escape the interior ' with \' See ?Quotes for details.
On Tue, Jul 18, 2017 at 12:48 PM, Christofer Bogaso <bogaso.christo...@gmail.com> wrote: > Hi again, > > Let say I have below string (arbitrary) > > <html> > <head> > <script type="text/javascript" <script type="text/javascript"> > mystatement('current', {'pac':['']}); > mystatement; > > > I want to pass above string to some R variable for further analysis. > So I have tried below : > > String = '<html> > <head> > <script type="text/javascript" <script type="text/javascript"> > mystatement('current', {'pac':['']}); > mystatement;' > > It is not clearly working as I am getting below error : > >> String = '<html> > > + <head> > > + <script type="text/javascript" <script type="text/javascript"> > > + mystatement('current', {'pac':['']}); > > Error: unexpected symbol in: > > " <script type="text/javascript" <script type="text/javascript"> > > mystatement('current" > >> mystatement;' > > Error: object 'mystatement' not found > >> > > > Any pointer how to create my string 'String' based on above would be > highly appreciated. > > Thanks for your time. > > ______________________________________________ > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. ______________________________________________ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.