Re: [R] Genuine relative paths with R

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

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
; 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

Re: [R] Genuine relative paths with R

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

Re: [R] Genuine relative paths with R

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

Re: [R] Genuine relative paths with R

2018-10-11 Thread Michael Friendly
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

Re: [R] Genuine relative paths with R

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

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'

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:   Aga

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 pr

Re: [R] Genuine relative paths with R

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

Re: [R] Genuine relative paths with R

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

Re: [R] Genuine relative paths with R

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

Re: [R] Genuine relative paths with R

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

Re: [R] Genuine relative paths with R

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

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 simpl

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 "curr

Re: [R] Genuine relative paths with R

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

Re: [R] Genuine relative paths with R

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

Re: [R] Genuine relative paths with R

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

Re: [R] Genuine relative paths with R

2018-10-10 Thread Olivier GIVAUDAN
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() {

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
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

Re: [R] Genuine relative paths with R

2018-10-10 Thread Tierney, Luke
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 >

Re: [R] Genuine relative paths with R

2018-10-10 Thread William Dunlap via R-help
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

Re: [R] Genuine relative paths with R

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

Re: [R] Genuine relative paths with R

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

Re: [R] Genuine relative paths with R

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

Re: [R] Genuine relative paths with R

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

Re: [R] Genuine relative paths with R

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

Re: [R] Genuine relative paths with R

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

Re: [R] Genuine relative paths with R

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

Re: [R] Genuine relative paths with R

2018-10-08 Thread MacQueen, Don via R-help
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'

Re: [R] Genuine relative paths with R

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

Re: [R] Genuine relative paths with R

2018-10-07 Thread Jeff Newmiller
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

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. > >

Re: [R] Genuine relative paths with R

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

Re: [R] Genuine relative paths with R

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

Re: [R] Genuine relative paths with R

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

Re: [R] Genuine relative paths with R

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

Re: [R] Genuine relative paths with R

2018-10-06 Thread Ista Zahn
> 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

Re: [R] Genuine relative paths with R

2018-10-06 Thread Ista Zahn
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(