[R] Trouble with Functions

Peter Ehlers ehlers at ucalgary.ca
Wed Jun 6 21:26:50 CEST 2012


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



More information about the R-help mailing list