Dear R users,
I would like to work with genuine relative paths in R for obvious reasons: if I
move all my scripts related to some project as a whole to another location of
my computer or someone else's computer, if want my scripts to continue to run
seamlessly.
What I mean by "genuine" is that
6 octobre 2018 19:31
� : r-help@r-project.org; Olivier GIVAUDAN; r-help@r-project.org
Objet : Re: [R] Genuine relative paths with R
I stopped using hardcoded absolute paths inside R scripts years ago, and I
suspect that is fairly common practice. That is, I almost never enter a path
starting with
is portable to other
machines.
What is particularly convenient about this is that it documents where
all the projects are on the machine right in the .Rproject file so
one always knows where they are.
On Sat, Oct 6, 2018 at 8:25 AM Olivier GIVAUDAN
wrote:
>> Dear R users,
>
> I would
s 'When a project is opened
within RStudio the following actions are taken: [...] The current working
directory is set to the project directory.', as stated on this page:
https://support.rstudio.com/hc/en-us/articles/200526207-Using-Projects.
So 'getwd()' returns exactly the sa
Exactly!
Best regards,
Olivier
____
De : MacQueen, Don
Envoyé : lundi 8 octobre 2018 16:04
À : Olivier GIVAUDAN; r-help@r-project.org
Objet : Re: [R] Genuine relative paths with R
A few facts (and some opinions):
First fact:
R understands relative paths (as do t
ing on the last version of Ubuntu)...
Best regards,
Olivier
De : Duncan Murdoch
Envoyé : mercredi 10 octobre 2018 14:51
À : Olivier GIVAUDAN; Jeff Newmiller
Cc : r-help@r-project.org
Objet : Re: [R] Genuine relative paths with R
On 10/10/2018 10:37 AM, Olivier
Well, no idea...
I just created a file 'TestPWD', made it executable, inserted in it these lines
and moved the file in various places:
#!/bin/bash
echo $PWD
read -p ""
De : Duncan Murdoch
Envoyé : mercredi 10 octobre 2018 15:20
À : Ol
To be able to change easily, cleanly and automatically the working directory
and thus to work with relative paths in the close neighbourhood of your R files.
De : William Dunlap
Envoyé : mercredi 10 octobre 2018 15:25
À : Olivier GIVAUDAN
Cc : Duncan Murdoch
Thank you, Luke.
Unfortunately I don't use Rscript (it is not allowed to run shell scripts on my
professional computer).
Best regards,
Olivier
De : Tierney, Luke
Envoy� : mercredi 10 octobre 2018 15:48
� : Olivier GIVAUDAN
Cc : Eik Vettorazzi; r-h
Why are you not simply double-clicking on 'TestPWD' and choosing to execute the
file (don't add anything)?
Are you executing the file from a terminal?
De : Duncan Murdoch
Envoyé : mercredi 10 octobre 2018 20:17
À : Olivier GIVAUDAN; Jeff Newmille
y calling it through a terminal for
instance.
De : R-help de la part de Olivier GIVAUDAN
Envoyé : mercredi 10 octobre 2018 20:42
À : Duncan Murdoch; Jeff Newmiller
Cc : r-help@r-project.org
Objet : Re: [R] Genuine relative paths with R
Why are you not simpl
eassuring).
Come on guys, creating a package... It's like using a hammer to kill a fly...
De : Duncan Murdoch
Envoy� : mercredi 10 octobre 2018 20:54
� : Olivier GIVAUDAN; Jeff Newmiller
Cc : r-help@r-project.org
Objet : Re: [R] Genuine relative paths with R
(only
local).
Best regards,
Olivier
[1] https://shiny.rstudio.com/articles/deployment-local.html
De : Fritsch, Katharina (NNL)
Envoyé : jeudi 11 octobre 2018 08:22
À : Olivier GIVAUDAN; Peter Claussen
Cc : r-help@r-project.org
Objet : RE: [R] Genuine relative paths
ks to Jeff Newmiller for his
patience and for having shared this "trick" with .RData file.
Best regards,
Olivier
De : Michael Friendly
Envoyé : jeudi 11 octobre 2018 13:08
À : Olivier GIVAUDAN; Duncan Murdoch; Jeff Newmiller
Cc : r-help@r-project.org
Sorry, I forgot:
The only regret I have is the title of this thread which is somehow misleading:
a more correct one would be "How to set automatically / dynamically the working
directory in R?"
De : Olivier GIVAUDAN
Envoyé : vendredi 19 octobre 20
#x27;m not deciding on
that unfortunately...
That would be for me the ideal solution.
Best regards,
Olivier
De : Fritsch, Katharina (NNL)
Envoyé : vendredi 19 octobre 2018 08:08
À : Olivier GIVAUDAN
Cc : r-help@r-project.org
Objet : RE: [R] Genuine relative pa
16 matches
Mail list logo