Skip to content

save at relative directory

5 messages · Alaios, Joshua Wiley, Uwe Ligges

#
Hi Alex,

Look at some of these functions:

apropos("dir")
apropos("exists")

Cheers,

Josh
On Tue, Nov 8, 2011 at 5:36 AM, Alaios <alaios at yahoo.com> wrote:

  
    
#
On 08.11.2011 16:09, Alaios wrote:
In R:
   unlink("-13", recursive=TRUE)

or in your shell:

I guess your intated OS can do:


rm --help
which points you to:
rm -r -- -13

Uwe Ligges
#
Hi Alex,

For the R part, I would abstract it a bit:

mydir <- paste("./", abs(threshold), sep = "")
if (!file.exists(mydir)) dir.create(mydir)
save(var, file = paste(mydir, DataSource[[4]], sep = "/"))

if you use file.exists('threshold') you are testing for the existence
of threshold, not the value contained in threshold, and anyway, you
seem not not want the value contained in threshold, but the absolute
value of the value in threshold, hence, in part, the value of
abstraction.

In R, see ?unlink for ways to delete things, rmdir looks like you are
using the command prompt, and for that I will refer you to the help
for your OS/shell on how to go about removing unwanted directories
(hint, rmdir --help is not a bad place to start ;)

Cheers,

Josh
On Tue, Nov 8, 2011 at 7:09 AM, Alaios <alaios at yahoo.com> wrote: