#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
: Olivier GIVAUDAN [mailto:olivier_givau...@hotmail.com]
Sent: 19 October 2018 06:26
To: Fritsch, Katharina (NNL); Peter Claussen
Cc: r-help@r-project.org
Subject: RE: [R] Genuine relative paths with R
Hi Katharina,
Apologies for the late reply.
Thank you for your proposal which was not made yet
; with your subject line.
>
> It's just a trick to work with relative paths without having to write any
> hardcoded (by definition) absolute path beforehand.
>
> De : Duncan Murdoch
> Envoy� : mercredi 10 octobre 2018 23:51
> � : Olivier GIVAUD
(by definition) absolute path beforehand.
>
> De : Duncan Murdoch
> Envoy� : mercredi 10 octobre 2018 23:51
> � : Olivier GIVAUDAN; Jeff Newmiller
> Cc : r-help@r-project.org
> Objet : Re: [R] Genuine relative paths with R
>
> On 10/10/2018 7
(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
octobre 2018 23:51
� : Olivier GIVAUDAN; Jeff Newmiller
Cc : r-help@r-project.org
Objet : Re: [R] Genuine relative paths with R
On 10/10/2018 7:11 PM, Olivier GIVAUDAN wrote:
It is not wrong to claim that R currently doesn't have a function
returning the path of the R file where this same func
tive paths without having to write
any hardcoded (by definition) absolute path beforehand.
*De :* Duncan Murdoch
*Envoyé :* mercredi 10 octobre 2018 23:51
*À :* Olivier GIVAUDAN; Jeff Newmiller
*Cc :* r-help@r-project.org
*Objet :
GIVAUDAN
Sent: 11 October 2018 00:54
To: Peter Claussen
Cc: r-help@r-project.org
Subject: Re: [R] Genuine relative paths with R
Yes, I am aware that both '__FILE__' and 'SAS_EXECFILENAME' are macro
variables. I don't know how the VBA 'Application.ThisWorkbook.Path'
-
*De :* Duncan Murdoch
*Envoyé :* mercredi 10 octobre 2018 22:59
*À :* Olivier GIVAUDAN; Jeff Newmiller
*Cc :* r-help@r-project.org
*Objet :* Re: [R] Genuine relative paths with R
On 10/10/2018 6:52 PM, Olivier GIVAUDAN wrote:
Aga
If I’m following all this correctly, it seems your criticism is that R doesn’t
provide a run-time function that is equivalent to a compile-time macro. You do
realize that __FILE__ is not part of the C programming language - it’s a
predefined variable recognized by the cpp - the C preprocessor pr
e of these 2
GUIs. So the workaround I finally found satisfies my current needs
*De :* Duncan Murdoch
*Envoyé :* mercredi 10 octobre 2018 22:07
*À :* Olivier GIVAUDAN; Jeff Newmiller
*Cc :* r-help@r-project.org
*Objet :* Re: [R] Genuine relative paths with R
On 10/10/2018 5:45 PM, Olivie
nd I finally found satisfies my current needs
*De :* Duncan Murdoch
*Envoyé :* mercredi 10 octobre 2018 22:07
*À :* Olivier GIVAUDAN; Jeff Newmiller
*Cc :* r-help@r-project.org
*Objet :* Re: [R] Genuine relative paths with R
On 10/10/2018 5:45 PM, Olivier GIVAUDAN wrote:
I'm not
-
*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
On 10/10/2018 4:42 PM, Olivier GIVAUDAN wrote:
Why are you not simply double-clicking on 'TestPWD' and choo
GIVAUDAN; Jeff Newmiller
*Cc :* r-help@r-project.org
*Objet :* Re: [R] Genuine relative paths with R
On 10/10/2018 4:42 PM, Olivier GIVAUDAN wrote:
Why are you not simply double-clicking on 'TestPWD' and choosing to
execute the file (don't add anything)?
Are you executing the file f
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
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
On 10/10/2018 4:42 PM, Olivier GIVAUDAN wrote:
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?
Yes, I was executing the file from my terminal. Otherwise I really have
no idea what the "curr
r
Cc : r-help@r-project.org
Objet : Re: [R] Genuine relative paths with R
On 10/10/2018 3:51 PM, Olivier GIVAUDAN wrote:
> Well, no idea...
>
> I just created a file 'TestPWD', made it executable, inserted in it
> these lines and moved the file in various places:
>
> #!/
ck
> Envoyé : samedi 6 octobre 2018 23:33
> À : olivier_givau...@hotmail.com; r-help@r-project.org
> Objet : Re: [R] Genuine relative paths with R
>
> 1. Assuming you are starting the script from within R, if you want to
> keep all the files used by the script together with the scr
-
*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 GIVAUDAN wrote:
Hi Jeff,
That is, there is not always a file in
elp@r-project.org
Objet : Re: [R] Genuine relative paths with R
If you are always running your main script as 'Rscript myscript.R'
then your file argument will appear as '--file=myscript.R' in
commandArgs(). So you can use something like
scriptFile <- function()
{
; Jeff Newmiller; r-help@r-project.org
Objet : Re: [R] Genuine relative paths with R
I am curious about why it is desirable for a script to know where in the file
system it is. Is it because you have a set of scripts invoking each other? If
so, the best route it to convert the scripts into functions
ivier GIVAUDAN; Jeff Newmiller
Cc : r-help@r-project.org
Objet : Re: [R] Genuine relative paths with R
On 10/10/2018 11:18 AM, Olivier GIVAUDAN wrote:
> Hi Duncan,
>
> Yes, if you need to display the content of $PWD you obviously need to
> type 'echo' before this variable.
>
&g
is package and this discussion (while I found
> the 'here' package). But thanks.
>
> Best regards,
>
> Olivier
>
> De : Eik Vettorazzi
> Envoy??? : lundi 8 octobre 2018 11:30
> ??? : Olivier GIVAUDAN; r-help@r-project.org
>
t; At least for me (I am running 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
och
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
nvoyé :* 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 GIVAUDAN wrote:
Hi Jeff,
That is, there is not always a file in a particular directory even involved in
the execu
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
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
..] 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 same as 'here()' does.
Best regards,
Olivier
______
me as 'here()' does.
Best regards,
Olivier
De : Jeff Newmiller
Envoyé : dimanche 7 octobre 2018 20:48
À : Olivier GIVAUDAN
Cc : Dénes Tóth; r-help@r-project.org
Objet : RE: [R] Genuine relative paths with R
On Sun, 7 Oct 2018, Olivier GIVAUDAN wrote:
amedi 6 octobre 2018 23:33
À : olivier_givau...@hotmail.com; r-help@r-project.org
Objet : Re: [R] Genuine relative paths with R
1. Assuming you are starting the script from within R, if you want to
keep all the files used by the script together with the script itself
then just source the script u
A few facts (and some opinions):
First fact:
R understands relative paths (as do the other languages you mentioned) (you
have misunderstood R if you think it doesn't)
Second fact:
R interprets relative paths as being relative to its current working directory
Third fact:
To find out R'
Dear Olivier,
you may find the rprojroot package useful, see
https://github.com/r-lib/rprojroot
and a discussion
https://gist.github.com/jennybc/362f52446fe1ebc4c49f#file-2014-10-12_stop-working-directory-insanity-md
Cheers
Am 06.10.2018 um 13:48 schrieb Olivier GIVAUDAN:
Dear R users,
I wou
ackages/R.utils/R.utils.pdf
End comment.
Best regards,
Olivier
_
De : D?nes T?th
Envoy? : samedi 6 octobre 2018 23:36
? : Olivier GIVAUDAN; Jeff Newmiller; r-help@r-project.org
Obje
__
> De : Ista Zahn
> Envoyé : samedi 6 octobre 2018 16:40
> À : olivier_givau...@hotmail.com; r-help@r-project.org
> Objet : Re: [R] Genuine relative paths with R
>
> Hi Olivier,
>
> Sorry for misspelling your name! Please see inline below.
>
>
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
>platform-independent.
>
>Best regards,
>
>Olivier
>
>De : Jeff Newmiller
>Envoyé : samedi 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
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 "/" or "c:/" in an R script.
The key concession you have to make is to start your R session in your working
directory using OS-sp
tudio or with the
> > default GUI.
> >
> > Best regards,
> >
> > Olivier (and not Oliver )
> >
> > De : Ista Zahn
> > Envoyé : samedi 6 octobre 2018 12:56
> > À : olivier_givau...@hotmail.com
> > Cc :
> De : Ista Zahn
> Envoyé : samedi 6 octobre 2018 12:56
> À : olivier_givau...@hotmail.com
> Cc : r-help@r-project.org
> Objet : Re: [R] Genuine relative paths with R
>
> Hi Oliver,
>
> Interesting question. Can you describe your motivation in a little
> more
Hi Oliver,
Interesting question. Can you describe your motivation in a little
more detail? That is, why do you what this feature? I ask because to
my way of thinking you have to know the path to the script in order to
call it in the first place. If calling from R, is
setwd("/path/to/dir")
source(
42 matches
Mail list logo