Re: [R] Genuine relative paths with R

2018-10-19 Thread Olivier GIVAUDAN
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 paths with R

Re: [R] Genuine relative paths with R

2018-10-19 Thread Fritsch, Katharina (NNL)
: 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

Re: [R] Genuine relative paths with R

2018-10-18 Thread Olivier GIVAUDAN
18 05:46 À : Michael Friendly; Duncan Murdoch; Jeff Newmiller Cc : r-help@r-project.org Objet : RE: Genuine relative paths with R Hi Michael, Apologies for the late reply. I am very grateful to all the R users who generously spent time on my problem and suggested operational solutions. It seems

Re: [R] Genuine relative paths with R

2018-10-18 Thread Olivier GIVAUDAN
. > > 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:11 PM, Olivier GIVAUDAN wrote: >>

Re: [R] Genuine relative paths with R

2018-10-18 Thread Olivier GIVAUDAN
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

Re: [R] Genuine relative paths with R

2018-10-11 Thread Michael Friendly
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 function was invoked. But it does. I

Re: [R] Genuine relative paths with R

2018-10-11 Thread Duncan Murdoch
rite 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 :* Re: [R] Genuine relative pat

Re: [R] Genuine relative paths with R

2018-10-11 Thread Fritsch, Katharina (NNL)
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' VBA or PHP '__DIR__' (or '__FILE__

Re: [R] Genuine relative paths with R

2018-10-10 Thread Duncan Murdoch
- *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:   Again, you seem to think making a package is a big deal.

Re: [R] Genuine relative paths with R

2018-10-10 Thread Peter Claussen via R-help
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

Re: [R] Genuine relative paths with R

2018-10-10 Thread Duncan Murdoch
LaTeX, SAS with macro-variables, etc.)?" Duncan Murdoch *De :* Duncan Murdoch *Envoyé :* mercredi 10 octobre 2018 22:31 *À :* Olivier GIVAUDAN; Jeff Newmiller *Cc :* r-help@r-project.org *Objet :* Re: [R] Genuine rela

Re: [R] Genuine relative paths with R

2018-10-10 Thread Duncan Murdoch
*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 sure I'm "inventing my own way" of dist

Re: [R] Genuine relative paths with R

2018-10-10 Thread Duncan Murdoch
UDAN; 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 from a terminal?

Re: [R] Genuine relative paths with R

2018-10-10 Thread Duncan Murdoch
-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 from a terminal? Yes, I was executing the file from my

Re: [R] Genuine relative paths with R

2018-10-10 Thread Olivier GIVAUDAN
, 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 On 10/10/2018 4:42 PM, Olivier

Re: [R] Genuine relative paths with R

2018-10-10 Thread Olivier GIVAUDAN
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 si

Re: [R] Genuine relative paths with R

2018-10-10 Thread Duncan Murdoch
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

Re: [R] Genuine relative paths with R

2018-10-10 Thread Olivier GIVAUDAN
-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: > > #!/bin/bash > > echo $

Re: [R] Genuine relative paths with R

2018-10-10 Thread Bert Gunter
obre 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 sour

Re: [R] Genuine relative paths with R

2018-10-10 Thread 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 a particular directory even involved in

Re: [R] Genuine relative paths with R

2018-10-10 Thread Olivier GIVAUDAN
-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() { pat <- "^--file=

Re: [R] Genuine relative paths with R

2018-10-10 Thread Olivier GIVAUDAN
; 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

Re: [R] Genuine relative paths with R

2018-10-10 Thread Olivier GIVAUDAN
UDAN; 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. > > It prints the use

Re: [R] Genuine relative paths with R

2018-10-10 Thread Tierney, Luke
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 > Objet : Re: [R] Genuine relati

Re: [R] Genuine relative paths with R

2018-10-10 Thread William Dunlap via R-help
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 : Re: [R] Genu

Re: [R] Genuine relative paths with R

2018-10-10 Thread Duncan Murdoch
, 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 GIVAUDAN

Re: [R] Genuine relative paths with R

2018-10-10 Thread Duncan Murdoch
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 executing code.​​ ​ True

Re: [R] Genuine relative paths with R

2018-10-10 Thread Olivier GIVAUDAN
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 GIVAUDAN wrote

Re: [R] Genuine relative paths with R

2018-10-10 Thread Olivier GIVAUDAN
__ 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 the other languages you mentioned) (you have

Re: [R] Genuine relative paths with R

2018-10-10 Thread Duncan Murdoch
26207-Using-Projects. So 'getwd()' returns exactly the same 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 w

Re: [R] Genuine relative paths with R

2018-10-10 Thread Olivier GIVAUDAN
er 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: > Hello Denes, > > > Yes, the path to the "root" folder of your project. You seem to have a > really esoteric context if you want to

Re: [R] Genuine relative paths with R

2018-10-10 Thread Olivier GIVAUDAN
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 using the absolute

Re: [R] Genuine relative paths with R

2018-10-08 Thread MacQueen, Don via R-help
directory. -Don -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave., L-627 Livermore, CA 94550 925-423-1062 Lab cell 925-724-7509 On 10/6/18, 4:48 AM, "R-help on behalf of Olivier GIVAUDAN" wrote: Dear R users, I would like to work with genuine

Re: [R] Genuine relative paths with R

2018-10-08 Thread Eik Vettorazzi
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

Re: [R] Genuine relative paths with R

2018-10-07 Thread Jeff Newmiller
nd 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 Objet : Re: [R] Genuine relative p

Re: [R] Genuine relative paths with R

2018-10-07 Thread Ista Zahn
___ > 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. > > On Sat,

Re: [R] Genuine relative paths with R

2018-10-06 Thread Olivier GIVAUDAN
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 "/&q

Re: [R] Genuine relative paths with R

2018-10-06 Thread Jeff Newmiller
orm-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 stop

Re: [R] Genuine relative paths with R

2018-10-06 Thread Jeff Newmiller
DAN wrote: >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

Re: [R] Genuine relative paths with R

2018-10-06 Thread Ista Zahn
gt; > default GUI. > > > > Best regards, > > > > Olivier (and not Oliver ) > > > > De : Ista Zahn > > Envoyé : samedi 6 octobre 2018 12:56 > > À : olivier_givau...@hotmail.com > > Cc : r-help@r-proj

Re: [R] Genuine relative paths with R

2018-10-06 Thread Ista Zahn
: 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 detail? That

Re: [R] Genuine relative paths with R

2018-10-06 Thread Ista Zahn
Oct 6, 2018 at 8:25 AM Olivier GIVAUDAN wrote: > > 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

[R] Genuine relative paths with R

2018-10-06 Thread Olivier GIVAUDAN
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 "ge