swirl icon indicating copy to clipboard operation
swirl copied to clipboard

Part 2. Workspace and Files. Task "setwd".

Open rumyantseva opened this issue 10 years ago • 6 comments

To change the working directory I typed

setwd("./testdir")

and the directory was changed by R. But swirl thought that it wasn't correct and expected just setwd("testdir") from me.

So I had to do

setwd("..")
setwd("testdir") 

to finish this task.

Do you think you could possible write some explanation for this task?

rumyantseva avatar Feb 23 '15 08:02 rumyantseva

Hi @rumyantseva,

I see what you mean. I'll make the appropriate changes to the lesson.

seankross avatar Feb 23 '15 16:02 seankross

It's probable that the course author used the default test, `omnitest(correctExpr='setwd("testdir")', in an early draft and neglected to generalize it to something like

any_of_exprs('setwd("testdir"), 'setwd("./testdir")')

in a later draft.

Perhaps swirl should reset the current working directory in circumstances like this. I'll cross-post the issue to the swirl 3.0 thread

WilCrofter avatar Feb 23 '15 16:02 WilCrofter

@WilCrofter I agree that's a good idea for swirl 3.0 and that this question should use any_of_exprs. Still, the Workspace and Files lesson should have some explanation about the meaning of . and .. so I'll work that in.

seankross avatar Feb 23 '15 17:02 seankross

On Mon, 23 Feb 2015 09:02:26 -0800 Sean Kross [email protected] wrote:

@WilCrofter I agree that's a good idea for swirl 3.0 and that this question should use any_of_exprs. Still, the Workspace and Files lesson should have some explanation about the meaning of . and .. so I'll work that in.


Reply to this email directly or view it on GitHub: https://github.com/swirldev/swirl/issues/266#issuecomment-75583720

Right. Thanks, Sean. I'm dashing in and out of swirl at the moment, so my remarks may not be all that coherent =D.

WilCrofter avatar Feb 23 '15 19:02 WilCrofter

Hi, I have the same issue - fedora 21, R 3.1.3, RStudio 0.98.1103

setwd("~/testdir") | Not quite, but you're learning! Try again. Or, type info() for more options. | Use setwd("testdir") to set your working directory to "testdir".

pipe0703 avatar May 12 '15 04:05 pipe0703

hello, i have the same issue m wondering what swirl requires

pam2307 avatar Jun 27 '20 11:06 pam2307