Haha no, TextWrangler. And that was definitely it...I think what was happening is that when I opened the text version of the book it opened in Notepad, which was probably opened the txt file in RTF. Then I copied and pasted the function code into TextWrangler and didn't even think about Smart Quotes. So I used the "Straighten Quote" feature. It got through all the way to the last line where I got an unexpected string error:
Error in source("/Documents/score.txt") : /Documents/score.txt:13:25: unexpected INCOMPLETE_STRING 32: return(scores.df) 33: } Is there a debug version I could be running or something that lists more descriptive error explanations? That way I don't have to bother you guys and embarrass myself so. :-) Thank you for your help! I appreciate it. On Wed, Jun 6, 2012 at 2:29 PM, Peter Ehlers [via R] < ml-node+s789695n4632578...@n4.nabble.com> wrote: > On 2012-06-05 17:00, dougmcintosh wrote: > > > FYI - here are the errors (I can get rid of the first one by removing > the > > progress parameter - which I understand controls whether a progress bar > is > > displayed). The second one stops at the gsub call. > > > > Maybe if someone could give me a properly formatted example I could work > > from instead? > > > > Thanks! > > (the caret is underneath the ? after progress in the first case, and > under > > the parenthesis in the second) > >> source('/Documents/score.txt') > > Error in source("Documents/score.txt") : > > /Users/dougmcintosh/Documents/score.txt:1:73: unexpected input > > 1: score.sentiment = function(sentences, pos.words, neg.words, .progress > = ? > > > >> source('/Documents/score.txt') > > Error in source("Documents/score.txt") : > > /Users/dougmcintosh/Documents/score.txt:15:17: unexpected input > > 14: > > 15: sentence = gsub(? > > > > I think that your problems may lie with an inappropriate editor > that's using 'smart' quotes. Please say you're not using Word. > > Peter Ehlers > > ______________________________________________ > [hidden email] <http://user/SendEmail.jtp?type=node&node=4632578&i=0>mailing > list > 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. > > > ------------------------------ > If you reply to this email, your message will be added to the discussion > below: > http://r.789695.n4.nabble.com/Trouble-with-Functions-tp4632456p4632578.html > To unsubscribe from Trouble with Functions, click > here<http://r.789695.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4632456&code=ZG91Zy5tY2ludG9zaEBnbWFpbC5jb218NDYzMjQ1NnwxMjA3ODQzNjMx> > . > NAML<http://r.789695.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml> > -- View this message in context: http://r.789695.n4.nabble.com/Trouble-with-Functions-tp4632456p4632579.html Sent from the R help mailing list archive at Nabble.com. [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list 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.