Skip to content

Works from CLI but not from prompt

8 messages · Sarah Goslee, Henri-Paul Indiogine, R. Michael Weylandt +1 more

#
Greegings!

Any idea why this works from the command line, but not from a source
file?  This is driving me (more) insane.

regexp <- "[Aa]ccountability"


Thanks!
#
What works? Assigning a string to a function, thus replacing the
function in your search
path?

Or is that what doesn't work?

What do you expect? What are you trying to do? Using what commands?

Sarah

On Tue, Sep 20, 2011 at 6:19 PM, Henri-Paul Indiogine
<hindiogine at gmail.com> wrote:
#
My apologies: not the name of a function, despite ?regexp having a return value.

But the rest of my questions are still relevant.
On Tue, Sep 20, 2011 at 6:32 PM, Sarah Goslee <sarah.goslee at gmail.com> wrote:
#
Hi Sarah!

2011/9/20 Sarah Goslee <sarah.goslee at gmail.com>:
Bad choice for character variable name on my part.  How about this?

pattern <- "[Aa]ccountability"

If I enter this at the CLI and then type "pattern", R returns
"[Aa]ccountability"

I I put this statement in a script then the variable "pattern" is not created.

Thanks,
#
On Sep 20, 2011, at 6:49 PM, Henri-Paul Indiogine wrote:

            
You are not illustrating the problem with enough detail to determine  
the source of your errors. The errors do not appear when tested in  
what appears to be the obvious manner:

 > pt1  <- "[Aa]ccountability"
 > grep(pt1, "accountability")
[1] 1
 > grep(pt1, "Accountability")
[1] 1
 > grep(pt1, "countability")
integer(0)

An old advertisement in TV in the US used to ask: "Where's the Beef?"
#
Greetings!

2011/9/20 David Winsemius <dwinsemius at comcast.net>:

There is probably an environment/scoping problem as you stated.  I am
using ESS and org-mode.

I started a new R code block and the problem disappeared.

Thanks for your kind feedback.

Henri-Paul