Re: [R] Associate a .R file with the RGui

2022-11-07 Thread Amarjit Chandhial via R-help


Hi Uwe,


Many Thanks.


Amarjiit 



> On 7 Nov 2022, at 14:00, Uwe Ligges  wrote:
> 
> 
> 
>> On 06.11.2022 19:43, Amarjit Chandhial wrote:
>> Hi Uwe,
>> I can do 1.
>> 1. Add the line
>> if ( length(z <- commandArgs(TRUE)) ) utils::file.edit(z[1])
>> to the Rprofile.site file; and
>> My Rprofile.site file is: "C:/PROGRA~1/R/R-42~1.2/etc/Rprofile.site"
>> How do I do 2, step-by-step?
>> 2. Edit the registry to associate the .R extension with the command
>> C:\Program Files\R\R-4.2.2\bin\x64\Rgui.exe --args "%1"
> 
> If you have not .R file association yet, you can add the line above when 
> being asked.
> If you have one, simply change the registry key
> 
> Computer\HKEY_CLASSES_ROOT\R_auto_file\shell\open\command
> 
> There is a standard value as extendable string (REG_EXPAND_SZ) and you simply 
> replace its content by
> 
> "C:\Program Files\R\R-4.2.2\bin\x64\Rgui.exe" --args "%1"
> 
> 
> and in
> 
> Computer\HKEY_CLASSES_ROOT\.R
> 
> there shoudl be a standard string (REG_SZ)
> R_auto_file
> 
> Best,
> Uwe Ligges
> 
> 
> 
> 
> 
>> Amarjit
>>-- Original Message --
>>From: "Uwe Ligges" 
>>To: "Amarjit Chandhial" ; "David
>>Winsemius" ; "Jeff Newmiller"
>>
>>Cc: "Amarjit Chandhial via R-help" 
>>Sent: Sunday, 6 Nov, 2022 At 17:19
>>Subject: Re: [R] Associate a .R file with the RGui
>>On 06.11.2022 17:21, Amarjit Chandhial via R-help wrote:
>>
>>Hi Uwe,
>>RGui does have advantages vs. RStudio, and vice-versa.
>>RStudio is much faster than it used to be.
>>I currently have .R files associated with RStudio, i.e. in File Explorer
>>if I double-click on a .R file it opens in the editor in RStudio as an R
>>script.
>>In File Explorer if I right-click on a .R file, Open with, I get the
>>options: R for Windows GUI Front-end or RStudio or Search the Microsoft
>>Store or choose another app.
>>If I choose R for Windows GUI Front-end, RGui (64-bit) opens, but no .R
>>file, in the editor.
>>If I choose RStudio the .R file opens in the editor in RStudio as an R
>>script.
>> From the adaptation, if I choose R for Windows GUI Front-end, will the
>>.R file open in RGui (64-bit) within the editor?
>>Yes.
>>
>>I have a new Windows PC and maybe, at least for the time being, it's
>>best for me to have them associated with RStudio.
>>Although, yes, I agree, it should be naturally implemented in R, having
>>installed RStudio.
>>I meant to implement that one can choose the internal editor to open
>>.R files. File associations can be set by RStudio, too, but that is
>>not an R(-core) matter.
>>Best,
>>Uwe Ligges
>>
>>thanks,
>>Amarjit
>>-- Original Message --
>>From: "Uwe Ligges" 
>>To: "David Winsemius" ; "Amarjit Chandhial"
>>; "Jeff Newmiller"
>>
>>Cc: "Amarjit Chandhial via R-help" 
>>Sent: Sunday, 6 Nov, 2022 At 15:15
>>Subject: Re: [R] Associate a .R file with the RGui
>>On 06.11.2022 01:40, David Winsemius wrote:
>>On 11/5/22 09:58, Amarjit Chandhial via R-help wrote:
>>Hi Jeff,
>>Please see my original question.
>>You were told that RGui is not an editor.
>>Are you implying that your initial message contained an implicit
>>request for instructions on how to get R code in an .R file to be opened
>>automagically when double-clicked or to have "open in "
>>appear when right-clicked? (I didn't see that clearly expressed.)
>>If you want something else to happen with a file that has a .R
>>extension when double-clicked or right-clicked in a GUI file manager,
>>then you need to configure your OS to do whatever else it is that you
>>expect. This is not really an R question. It's an OS question. There are
>>many editors that can also bring up R consoles when the right key combo
>>is pressed. They do require some study for their specific actions, but
>>this is not really the place to get guidance on the fine details.
>>Friends, RGui contains an editor. It allows to send lines / code
>>blocks to the R concole. We know users who need braille displays use the
>>RGui internal editor as that apparently cooperates bette

Re: [R] Associate a .R file with the RGui

2022-11-07 Thread Uwe Ligges




On 06.11.2022 19:43, Amarjit Chandhial wrote:


Hi Uwe,




I can do 1.



1. Add the line

if ( length(z <- commandArgs(TRUE)) ) utils::file.edit(z[1])

to the Rprofile.site file; and


My Rprofile.site file is: "C:/PROGRA~1/R/R-42~1.2/etc/Rprofile.site"



How do I do 2, step-by-step?


2. Edit the registry to associate the .R extension with the command

C:\Program Files\R\R-4.2.2\bin\x64\Rgui.exe --args "%1"


If you have not .R file association yet, you can add the line above when 
being asked.

If you have one, simply change the registry key

Computer\HKEY_CLASSES_ROOT\R_auto_file\shell\open\command

There is a standard value as extendable string (REG_EXPAND_SZ) and you 
simply replace its content by


"C:\Program Files\R\R-4.2.2\bin\x64\Rgui.exe" --args "%1"


and in

Computer\HKEY_CLASSES_ROOT\.R

there shoudl be a standard string (REG_SZ)
R_auto_file

Best,
Uwe Ligges









Amarjit






-- Original Message --
From: "Uwe Ligges" 
To: "Amarjit Chandhial" ; "David
Winsemius" ; "Jeff Newmiller"

Cc: "Amarjit Chandhial via R-help" 
Sent: Sunday, 6 Nov, 2022 At 17:19
Subject: Re: [R] Associate a .R file with the RGui



On 06.11.2022 17:21, Amarjit Chandhial via R-help wrote:



Hi Uwe,


RGui does have advantages vs. RStudio, and vice-versa.

RStudio is much faster than it used to be.

I currently have .R files associated with RStudio, i.e. in File Explorer
if I double-click on a .R file it opens in the editor in RStudio as an R
script.

In File Explorer if I right-click on a .R file, Open with, I get the
options: R for Windows GUI Front-end or RStudio or Search the Microsoft
Store or choose another app.
If I choose R for Windows GUI Front-end, RGui (64-bit) opens, but no .R
file, in the editor.
If I choose RStudio the .R file opens in the editor in RStudio as an R
script.

 From the adaptation, if I choose R for Windows GUI Front-end, will the
.R file open in RGui (64-bit) within the editor?


Yes.




I have a new Windows PC and maybe, at least for the time being, it's
best for me to have them associated with RStudio.

Although, yes, I agree, it should be naturally implemented in R, having
installed RStudio.


I meant to implement that one can choose the internal editor to open
.R files. File associations can be set by RStudio, too, but that is
not an R(-core) matter.

Best,
Uwe Ligges




thanks,
Amarjit




-- Original Message --
From: "Uwe Ligges" 
To: "David Winsemius" ; "Amarjit Chandhial"
    ; "Jeff Newmiller"
    
Cc: "Amarjit Chandhial via R-help" 
Sent: Sunday, 6 Nov, 2022 At 15:15
Subject: Re: [R] Associate a .R file with the RGui


On 06.11.2022 01:40, David Winsemius wrote:

On 11/5/22 09:58, Amarjit Chandhial via R-help wrote:
Hi Jeff,


Please see my original question.

You were told that RGui is not an editor.

Are you implying that your initial message contained an implicit
request for instructions on how to get R code in an .R file to be opened
automagically when double-clicked or to have "open in "
appear when right-clicked? (I didn't see that clearly expressed.)

If you want something else to happen with a file that has a .R
extension when double-clicked or right-clicked in a GUI file manager,
then you need to configure your OS to do whatever else it is that you
expect. This is not really an R question. It's an OS question. There are
many editors that can also bring up R consoles when the right key combo
is pressed. They do require some study for their specific actions, but
this is not really the place to get guidance on the fine details.


Friends, RGui contains an editor. It allows to send lines / code
blocks to the R concole. We know users who need braille displays use the
RGui internal editor as that apparently cooperates better with braille
displays + R as many other editors.
And as it does not hide half of R by its own functions, I'd pefer that
over some very popular other editors if I had no other choice.


To answer the OP's question, R does not have a built in way to get
this task directly done, but searching the web suggests a rather simple
way (well,m a hack as starting R with other command args may fail now,
but you can extend this and look for a specific naming scheme):

<https://stat.ethz.ch/pipermail/r-help/2007-August/138064.html
<https://stat.ethz.ch/pipermail/r-help/2007-August/138064.html>
<https://stat.ethz.ch/pipermail/r-help/2007-August/138064.html
<https://stat.ethz.ch/pipermail/r-help/2007-August/138064.html>>

Re: [R] Associate a .R file with the RGui

2022-11-06 Thread Amarjit Chandhial via R-help




Hi Uwe,



I can do 1.


   1. Add the line
if ( length(z <- commandArgs(TRUE)) ) utils::file.edit(z[1])
to the Rprofile.site file; and

My Rprofile.site file is: "C:/PROGRA~1/R/R-42~1.2/etc/Rprofile.site"

How do I do 2, step-by-step?

2. Edit the registry to associate the .R extension with the command
C:\Program Files\R\R-4.2.2\bin\x64\Rgui.exe --args "%1"



Amarjit



-- Original Message --
From: "Uwe Ligges" 
To: "Amarjit Chandhial" ; "David Winsemius" 
; "Jeff Newmiller" 
Cc: "Amarjit Chandhial via R-help" 
Sent: Sunday, 6 Nov, 2022 At 17:19
Subject: Re: [R] Associate a .R file with the RGui

On 06.11.2022 17:21, Amarjit Chandhial via R-help wrote:

Hi Uwe,

RGui does have advantages vs. RStudio, and vice-versa.
RStudio is much faster than it used to be.
I currently have .R files associated with RStudio, i.e. in File Explorer
if I double-click on a .R file it opens in the editor in RStudio as an R
script.
In File Explorer if I right-click on a .R file, Open with, I get the
options: R for Windows GUI Front-end or RStudio or Search the Microsoft
Store or choose another app.
If I choose R for Windows GUI Front-end, RGui (64-bit) opens, but no .R
file, in the editor.
If I choose RStudio the .R file opens in the editor in RStudio as an R
script.
   From the adaptation, if I choose R for Windows GUI Front-end, will 
the
.R file open in RGui (64-bit) within the editor?
Yes.


I have a new Windows PC and maybe, at least for the time being, it's
best for me to have them associated with RStudio.
Although, yes, I agree, it should be naturally implemented in R, having
installed RStudio.
I meant to implement that one can choose the internal editor to open .R 
files. File associations can be set by RStudio, too, but that is not an 
R(-core) matter.
Best,
Uwe Ligges


thanks,
Amarjit


-- Original Message --
From: "Uwe Ligges" 
To: "David Winsemius" ; "Amarjit Chandhial"
; "Jeff Newmiller"

Cc: "Amarjit Chandhial via R-help" 
Sent: Sunday, 6 Nov, 2022 At 15:15
Subject: Re: [R] Associate a .R file with the RGui

On 06.11.2022 01:40, David Winsemius wrote:
On 11/5/22 09:58, Amarjit Chandhial via R-help wrote:
Hi Jeff,

Please see my original question.
You were told that RGui is not an editor.
Are you implying that your initial message contained an implicit
request for instructions on how to get R code in an .R file to be opened
automagically when double-clicked or to have "open in "
appear when right-clicked? (I didn't see that clearly expressed.)
If you want something else to happen with a file that has a .R
extension when double-clicked or right-clicked in a GUI file manager,
then you need to configure your OS to do whatever else it is that you
expect. This is not really an R question. It's an OS question. There are
many editors that can also bring up R consoles when the right  key combo
is pressed. They do require some study for their specific actions, but
this is not really the place to get guidance on the fine details.

Friends, RGui contains an editor. It allows to send lines / code
blocks to the R concole. We know users who need braille displays use the
RGui internal editor as that apparently cooperates better with braille
displays + R as many other editors.
And as it does not hide half of R by its own functions, I'd pefer 
that
over some very popular other editors if I had no other choice.

To answer the OP's question, R does not have a built in way to get
this task directly done, but searching the web suggests a rather simple
way (well,m a hack as starting R with other command args may fail now,
but you can extend this and look for a specific naming scheme):
<https://stat.ethz.ch/pipermail/r-help/2007-August/138064.html 
<https://stat.ethz.ch/pipermail/r-help/2007-August/138064.html>
<https://stat.ethz.ch/pipermail/r-help/2007-August/138064.html 
<https://stat.ethz.ch/pipermail/r-help/2007-August/138064.html> > >
let is adapt this for the recent version of R:

1. Add the line
if ( length(z <- commandArgs(TRUE)) ) utils::file.edit(z[1])
to the Rprofile.site file; and
2. Edit the registry to associate the .R extension with the command
C:\Program Files\R\R-4.2.2\bin\x64\Rgui.exe --args "%1"

I think we should implement this in R anyway.
Best,
Uwe Ligges



[[alternative HTML version deleted]]
__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help 
<https://stat.ethz.ch/mailman/listinfo/r-help>
PLEASE do read the posting guide 
http://www.R-project.org/posting-guide.html 
<http://www.R-project.org/posting-guide.html>
and provide commented, minimal, self-contained, reproducible code.

[[alternative

Re: [R] Associate a .R file with the RGui

2022-11-06 Thread Uwe Ligges




On 06.11.2022 17:21, Amarjit Chandhial via R-help wrote:




Hi Uwe,


RGui does have advantages vs. RStudio, and vice-versa.

RStudio is much faster than it used to be.

I currently have .R files associated with RStudio, i.e. in File Explorer
if I double-click on a .R file it opens in the editor in RStudio as an R
script.

In File Explorer if I right-click on a .R file, Open with, I get the
options: R for Windows GUI Front-end or RStudio or Search the Microsoft
Store or choose another app.
If I choose R for Windows GUI Front-end, RGui (64-bit) opens, but no .R
file, in the editor.
If I choose RStudio the .R file opens in the editor in RStudio as an R
script.

  From the adaptation, if I choose R for Windows GUI Front-end, will the
.R file open in RGui (64-bit) within the editor?


Yes.





I have a new Windows PC and maybe, at least for the time being, it's
best for me to have them associated with RStudio.

Although, yes, I agree, it should be naturally implemented in R, having
installed RStudio.


I meant to implement that one can choose the internal editor to open .R 
files. File associations can be set by RStudio, too, but that is not an 
R(-core) matter.


Best,
Uwe Ligges





thanks,
Amarjit




-- Original Message --
From: "Uwe Ligges" 
To: "David Winsemius" ; "Amarjit Chandhial"
; "Jeff Newmiller"

Cc: "Amarjit Chandhial via R-help" 
Sent: Sunday, 6 Nov, 2022 At 15:15
Subject: Re: [R] Associate a .R file with the RGui


   On 06.11.2022 01:40, David Winsemius wrote:

   On 11/5/22 09:58, Amarjit Chandhial via R-help wrote:
   Hi Jeff,


   Please see my original question.

   You were told that RGui is not an editor.

   Are you implying that your initial message contained an implicit
request for instructions on how to get R code in an .R file to be opened
automagically when double-clicked or to have "open in "
appear when right-clicked? (I didn't see that clearly expressed.)

   If you want something else to happen with a file that has a .R
extension when double-clicked or right-clicked in a GUI file manager,
then you need to configure your OS to do whatever else it is that you
expect. This is not really an R question. It's an OS question. There are
many editors that can also bring up R consoles when the right  key combo
is pressed. They do require some study for their specific actions, but
this is not really the place to get guidance on the fine details.


   Friends, RGui contains an editor. It allows to send lines / code
blocks to the R concole. We know users who need braille displays use the
RGui internal editor as that apparently cooperates better with braille
displays + R as many other editors.
   And as it does not hide half of R by its own functions, I'd pefer that
over some very popular other editors if I had no other choice.


   To answer the OP's question, R does not have a built in way to get
this task directly done, but searching the web suggests a rather simple
way (well,m a hack as starting R with other command args may fail now,
but you can extend this and look for a specific naming scheme):

   <https://stat.ethz.ch/pipermail/r-help/2007-August/138064.html
<https://stat.ethz.ch/pipermail/r-help/2007-August/138064.html> >

   let is adapt this for the recent version of R:


   1. Add the line

   if ( length(z <- commandArgs(TRUE)) ) utils::file.edit(z[1])

   to the Rprofile.site file; and

   2. Edit the registry to associate the .R extension with the command

   C:\Program Files\R\R-4.2.2\bin\x64\Rgui.exe --args "%1"


   I think we should implement this in R anyway.

   Best,
   Uwe Ligges







[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Associate a .R file with the RGui

2022-11-06 Thread Amarjit Chandhial via R-help




Hi Uwe,


RGui does have advantages vs. RStudio, and vice-versa.

RStudio is much faster than it used to be.

I currently have .R files associated with RStudio, i.e. in File Explorer 
if I double-click on a .R file it opens in the editor in RStudio as an R 
script.

In File Explorer if I right-click on a .R file, Open with, I get the 
options: R for Windows GUI Front-end or RStudio or Search the Microsoft 
Store or choose another app.
If I choose R for Windows GUI Front-end, RGui (64-bit) opens, but no .R 
file, in the editor.
If I choose RStudio the .R file opens in the editor in RStudio as an R 
script.

 From the adaptation, if I choose R for Windows GUI Front-end, will the 
.R file open in RGui (64-bit) within the editor?


I have a new Windows PC and maybe, at least for the time being, it's 
best for me to have them associated with RStudio.

Although, yes, I agree, it should be naturally implemented in R, having 
installed RStudio.


thanks,
Amarjit




-- Original Message --
From: "Uwe Ligges" 
To: "David Winsemius" ; "Amarjit Chandhial" 
; "Jeff Newmiller" 

Cc: "Amarjit Chandhial via R-help" 
Sent: Sunday, 6 Nov, 2022 At 15:15
Subject: Re: [R] Associate a .R file with the RGui


  On 06.11.2022 01:40, David Winsemius wrote:

  On 11/5/22 09:58, Amarjit Chandhial via R-help wrote:
  Hi Jeff,


  Please see my original question.

  You were told that RGui is not an editor.

  Are you implying that your initial message contained an implicit 
request for instructions on how to get R code in an .R file to be opened 
automagically when double-clicked or to have "open in " 
appear when right-clicked? (I didn't see that clearly expressed.)

  If you want something else to happen with a file that has a .R 
extension when double-clicked or right-clicked in a GUI file manager, 
then you need to configure your OS to do whatever else it is that you 
expect. This is not really an R question. It's an OS question. There are 
many editors that can also bring up R consoles when the right  key combo 
is pressed. They do require some study for their specific actions, but 
this is not really the place to get guidance on the fine details.


  Friends, RGui contains an editor. It allows to send lines / code 
blocks to the R concole. We know users who need braille displays use the 
RGui internal editor as that apparently cooperates better with braille 
displays + R as many other editors.
  And as it does not hide half of R by its own functions, I'd pefer that 
over some very popular other editors if I had no other choice.


  To answer the OP's question, R does not have a built in way to get 
this task directly done, but searching the web suggests a rather simple 
way (well,m a hack as starting R with other command args may fail now, 
but you can extend this and look for a specific naming scheme):

  <https://stat.ethz.ch/pipermail/r-help/2007-August/138064.html 
<https://stat.ethz.ch/pipermail/r-help/2007-August/138064.html> >

  let is adapt this for the recent version of R:


  1. Add the line

  if ( length(z <- commandArgs(TRUE)) ) utils::file.edit(z[1])

  to the Rprofile.site file; and

  2. Edit the registry to associate the .R extension with the command

  C:\Program Files\R\R-4.2.2\bin\x64\Rgui.exe --args "%1"


  I think we should implement this in R anyway.

  Best,
  Uwe Ligges







[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Associate a .R file with the RGui

2022-11-06 Thread Uwe Ligges




On 06.11.2022 01:40, David Winsemius wrote:


On 11/5/22 09:58, Amarjit Chandhial via R-help wrote:

Hi Jeff,


Please see my original question.


You were told that RGui is not an editor.

Are you implying that your initial message contained an implicit request 
for instructions on how to get R code in an .R file to be opened 
automagically when double-clicked or to have "open in " 
appear when right-clicked? (I didn't see that clearly expressed.)


If you want something else to happen with a file that has a .R extension 
when double-clicked or right-clicked in a GUI file manager, then you 
need to configure your OS to do whatever else it is that you expect. 
This is not really an R question. It's an OS question. There are many 
editors that can also bring up R consoles when the right  key combo is 
pressed. They do require some study for their specific actions, but this 
is not really the place to get guidance on the fine details.




Friends, RGui contains an editor. It allows to send lines / code blocks 
to the R concole. We know users who need braille displays use the RGui 
internal editor as that apparently cooperates better with braille 
displays + R as many other editors.
And as it does not hide half of R by its own functions, I'd pefer that 
over some very popular other editors if I had no other choice.



To answer the OP's question, R does not have a built in way to get this 
task directly done, but searching the web suggests a rather simple way 
(well,m a hack as starting R with other command args may fail now, but 
you can extend this and look for a specific naming scheme):




let is adapt this for the recent version of R:


1. Add the line

if ( length(z <- commandArgs(TRUE)) ) utils::file.edit(z[1])

to the Rprofile.site file; and

2. Edit the registry to associate the .R extension with the command

C:\Program Files\R\R-4.2.2\bin\x64\Rgui.exe --args "%1"


I think we should implement this in R anyway.

Best,
Uwe Ligges

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Associate a .R file with the RGui

2022-11-06 Thread Amarjit Chandhial via R-help
David,

Thanks.

Amarjiit 


> On 6 Nov 2022, at 00:40, David Winsemius  wrote:
> 
> 
>> On 11/5/22 09:58, Amarjit Chandhial via R-help wrote:
>> Hi Jeff,
>> 
>> 
>> Please see my original question.
> 
> You were told that RGui is not an editor.
> 
> Are you implying that your initial message contained an implicit request for 
> instructions on how to get R code in an .R file to be opened automagically 
> when double-clicked or to have "open in " appear when 
> right-clicked? (I didn't see that clearly expressed.)
> 
> If you want something else to happen with a file that has a .R extension when 
> double-clicked or right-clicked in a GUI file manager, then you need to 
> configure your OS to do whatever else it is that you expect. This is not 
> really an R question. It's an OS question. There are many editors that can 
> also bring up R consoles when the right  key combo is pressed. They do 
> require some study for their specific actions, but this is not really the 
> place to get guidance on the fine details.
> 
> -- 
> 
> David.
> 
>> 
>> 
>> Thanks,
>> Amarjiit
>> 
>> 
>> 
>>> On 5 Nov 2022, at 15:03, Jeff Newmiller  wrote:
>>> 
>>> RGui is not an editor. It is a console (aka REPL, 
>>> https://en.wikipedia.org/wiki/Read%E2%80%93eval%E2%80%93print_loop).
>>> 
>>> When using RGui, it is up to you to edit your R file in an external editor 
>>> like Notepad++ and copy paste code snippets or use source("yourfile.R") as 
>>> desired.
>>> 
>>>> On November 5, 2022 6:47:54 AM PDT, Amarjit Chandhial via R-help 
>>>>  wrote:
>>>> 
>>>> 
>>>> 
>>>> Hi Andrew/Petr,
>>>> 
>>>> 
>>>> Thanks for the replies.
>>>> 
>>>> In R Console if I run:
>>>> 
>>>> R.home("bin")
>>>> 
>>>> I get the following
>>>> 
>>>> "C:/PROGRA~1/R/R-42~1.2/bin/x64"
>>>> 
>>>> which is where
>>>> 
>>>> Rgui.exe is (within the x64 folder there are 13 files in total: 8 . exe
>>>> and 5 .dll).
>>>> 
>>>> 
>>>> In file Explorer if I right-click on a .R file -> Open With -> R for
>>>> Windows GUI Front-End
>>>> 
>>>> RGui (64-bit) opens but the .R file does not appear in the editor.
>>>> 
>>>> 
>>>> Amarjit
>>>> 
>>>> 
>>>> -- Original Message --
>>>> From: "Andrew Simmons" 
>>>> To: "Amarjit Chandhial" 
>>>> Cc: "R-help Mailing List" 
>>>> Sent: Friday, 4 Nov, 2022 At 09:08
>>>> Subject: Re: [R] Associate a .R file with the RGui
>>>> 
>>>> In an R session, run this:
>>>> 
>>>> writeLines(normalizePath(R.home("bin")))
>>>> 
>>>> 
>>>> Right click your .R file > Open with > Choose another app > Check the
>>>> box "Always use this app to open .R files" > Look for another app on
>>>> this PC
>>>> Paste the directory found above, then select "Rgui.exe"
>>>> 
>>>> 
>>>> On Fri, Nov 4, 2022, 04:49 Amarjit Chandhial via R-help
>>>> mailto:r-help@r-project.org> > wrote:
>>>> 
>>>> Hi,
>>>> 
>>>> 
>>>> My OS is Windows 11 Pro 64-Bit, I have R 4.2.2 and RStudio installed.
>>>> 
>>>> If I double-click on a .R file in File Explorer the OS gives me the
>>>> option of opening the .R in RStudio, or Look for an app in the
>>>> Microsoft
>>>> Store, or More Apps. Similarly with a right-click.
>>>> 
>>>> I would like to associate a .R file with the RGui, not RStudio, thus
>>>> when I double-click on a .R file in File Explorer the .R file opens in
>>>> the R Editor in RGui.
>>>> 
>>>> On my PC R 4.2.2 is located in "C:/Program Files/R/R-4.2.2/etc"
>>>> 
>>>> Please can someone provide step-by-step instructions on how to
>>>> associate?
>>>> 
>>>> 
>>>> thanks,
>>>> Amarjit
>>>> 
>>>> [[alternative HTML version deleted]]
>>>> 
>>>> __
>>>> R-help@r-project.org <mailto:R-help@r-project.org>  ma

Re: [R] Associate a .R file with the RGui

2022-11-05 Thread David Winsemius



On 11/5/22 09:58, Amarjit Chandhial via R-help wrote:

Hi Jeff,


Please see my original question.


You were told that RGui is not an editor.

Are you implying that your initial message contained an implicit request 
for instructions on how to get R code in an .R file to be opened 
automagically when double-clicked or to have "open in " 
appear when right-clicked? (I didn't see that clearly expressed.)


If you want something else to happen with a file that has a .R extension 
when double-clicked or right-clicked in a GUI file manager, then you 
need to configure your OS to do whatever else it is that you expect. 
This is not really an R question. It's an OS question. There are many 
editors that can also bring up R consoles when the right  key combo is 
pressed. They do require some study for their specific actions, but this 
is not really the place to get guidance on the fine details.


--

David.




Thanks,
Amarjiit




On 5 Nov 2022, at 15:03, Jeff Newmiller  wrote:

RGui is not an editor. It is a console (aka REPL, 
https://en.wikipedia.org/wiki/Read%E2%80%93eval%E2%80%93print_loop).

When using RGui, it is up to you to edit your R file in an external editor like Notepad++ 
and copy paste code snippets or use source("yourfile.R") as desired.


On November 5, 2022 6:47:54 AM PDT, Amarjit Chandhial via R-help 
 wrote:



Hi Andrew/Petr,


Thanks for the replies.

In R Console if I run:

R.home("bin")

I get the following

"C:/PROGRA~1/R/R-42~1.2/bin/x64"

which is where

Rgui.exe is (within the x64 folder there are 13 files in total: 8 . exe
and 5 .dll).


In file Explorer if I right-click on a .R file -> Open With -> R for
Windows GUI Front-End

RGui (64-bit) opens but the .R file does not appear in the editor.


Amarjit


-- Original Message --
From: "Andrew Simmons" 
To: "Amarjit Chandhial" 
Cc: "R-help Mailing List" 
Sent: Friday, 4 Nov, 2022 At 09:08
Subject: Re: [R] Associate a .R file with the RGui

In an R session, run this:

writeLines(normalizePath(R.home("bin")))


Right click your .R file > Open with > Choose another app > Check the
box "Always use this app to open .R files" > Look for another app on
this PC
Paste the directory found above, then select "Rgui.exe"


On Fri, Nov 4, 2022, 04:49 Amarjit Chandhial via R-help
mailto:r-help@r-project.org> > wrote:

Hi,


My OS is Windows 11 Pro 64-Bit, I have R 4.2.2 and RStudio installed.

If I double-click on a .R file in File Explorer the OS gives me the
option of opening the .R in RStudio, or Look for an app in the
Microsoft
Store, or More Apps. Similarly with a right-click.

I would like to associate a .R file with the RGui, not RStudio, thus
when I double-click on a .R file in File Explorer the .R file opens in
the R Editor in RGui.

On my PC R 4.2.2 is located in "C:/Program Files/R/R-4.2.2/etc"

Please can someone provide step-by-step instructions on how to
associate?


thanks,
Amarjit

 [[alternative HTML version deleted]]

__
R-help@r-project.org <mailto:R-help@r-project.org>  mailing list -- To
UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
<https://stat.ethz.ch/mailman/listinfo/r-help>
PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html
<http://www.R-project.org/posting-guide.html>
and provide commented, minimal, self-contained, reproducible code.




[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

--
Sent from my phone. Please excuse my brevity.

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Associate a .R file with the RGui

2022-11-05 Thread Amarjit Chandhial via R-help
Hi Jeff,


Please see my original question.


Thanks,
Amarjiit 



> On 5 Nov 2022, at 15:03, Jeff Newmiller  wrote:
> 
> RGui is not an editor. It is a console (aka REPL, 
> https://en.wikipedia.org/wiki/Read%E2%80%93eval%E2%80%93print_loop).
> 
> When using RGui, it is up to you to edit your R file in an external editor 
> like Notepad++ and copy paste code snippets or use source("yourfile.R") as 
> desired.
> 
>> On November 5, 2022 6:47:54 AM PDT, Amarjit Chandhial via R-help 
>>  wrote:
>> 
>> 
>> 
>> Hi Andrew/Petr,
>> 
>> 
>> Thanks for the replies.
>> 
>> In R Console if I run:
>> 
>> R.home("bin")
>> 
>> I get the following
>> 
>> "C:/PROGRA~1/R/R-42~1.2/bin/x64"
>> 
>> which is where
>> 
>> Rgui.exe is (within the x64 folder there are 13 files in total: 8 . exe 
>> and 5 .dll).
>> 
>> 
>> In file Explorer if I right-click on a .R file -> Open With -> R for 
>> Windows GUI Front-End
>> 
>> RGui (64-bit) opens but the .R file does not appear in the editor.
>> 
>> 
>> Amarjit
>> 
>> 
>> -- Original Message --
>> From: "Andrew Simmons" 
>> To: "Amarjit Chandhial" 
>> Cc: "R-help Mailing List" 
>> Sent: Friday, 4 Nov, 2022 At 09:08
>> Subject: Re: [R] Associate a .R file with the RGui
>> 
>> In an R session, run this:
>> 
>> writeLines(normalizePath(R.home("bin")))
>> 
>> 
>> Right click your .R file > Open with > Choose another app > Check the 
>> box "Always use this app to open .R files" > Look for another app on 
>> this PC
>> Paste the directory found above, then select "Rgui.exe"
>> 
>> 
>> On Fri, Nov 4, 2022, 04:49 Amarjit Chandhial via R-help 
>> mailto:r-help@r-project.org> > wrote:
>> 
>> Hi,
>> 
>> 
>> My OS is Windows 11 Pro 64-Bit, I have R 4.2.2 and RStudio installed.
>> 
>> If I double-click on a .R file in File Explorer the OS gives me the
>> option of opening the .R in RStudio, or Look for an app in the 
>> Microsoft
>> Store, or More Apps. Similarly with a right-click.
>> 
>> I would like to associate a .R file with the RGui, not RStudio, thus
>> when I double-click on a .R file in File Explorer the .R file opens in
>> the R Editor in RGui.
>> 
>> On my PC R 4.2.2 is located in "C:/Program Files/R/R-4.2.2/etc"
>> 
>> Please can someone provide step-by-step instructions on how to
>> associate?
>> 
>> 
>> thanks,
>> Amarjit
>> 
>> [[alternative HTML version deleted]]
>> 
>> __
>> R-help@r-project.org <mailto:R-help@r-project.org>  mailing list -- To 
>> UNSUBSCRIBE and more, see
>> https://stat.ethz.ch/mailman/listinfo/r-help 
>> <https://stat.ethz.ch/mailman/listinfo/r-help>
>> PLEASE do read the posting guide 
>> http://www.R-project.org/posting-guide.html 
>> <http://www.R-project.org/posting-guide.html>
>> and provide commented, minimal, self-contained, reproducible code.
>> 
>> 
>> 
>> 
>>[[alternative HTML version deleted]]
>> 
>> __
>> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
> 
> -- 
> Sent from my phone. Please excuse my brevity.

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Associate a .R file with the RGui

2022-11-05 Thread Jeff Newmiller
RGui is not an editor. It is a console (aka REPL, 
https://en.wikipedia.org/wiki/Read%E2%80%93eval%E2%80%93print_loop).

When using RGui, it is up to you to edit your R file in an external editor like 
Notepad++ and copy paste code snippets or use source("yourfile.R") as desired.

On November 5, 2022 6:47:54 AM PDT, Amarjit Chandhial via R-help 
 wrote:
>
>
>
>Hi Andrew/Petr,
>
>
>Thanks for the replies.
>
>In R Console if I run:
>
>R.home("bin")
>
>I get the following
>
>"C:/PROGRA~1/R/R-42~1.2/bin/x64"
>
>which is where
>
>Rgui.exe is (within the x64 folder there are 13 files in total: 8 . exe 
>and 5 .dll).
>
>
>In file Explorer if I right-click on a .R file -> Open With -> R for 
>Windows GUI Front-End
>
>RGui (64-bit) opens but the .R file does not appear in the editor.
>
>
>Amarjit
>
>
>-- Original Message --
>From: "Andrew Simmons" 
>To: "Amarjit Chandhial" 
>Cc: "R-help Mailing List" 
>Sent: Friday, 4 Nov, 2022 At 09:08
>Subject: Re: [R] Associate a .R file with the RGui
>
>In an R session, run this:
>
>writeLines(normalizePath(R.home("bin")))
>
>
>Right click your .R file > Open with > Choose another app > Check the 
>box "Always use this app to open .R files" > Look for another app on 
>this PC
>Paste the directory found above, then select "Rgui.exe"
>
>
>On Fri, Nov 4, 2022, 04:49 Amarjit Chandhial via R-help 
>mailto:r-help@r-project.org> > wrote:
>
>  Hi,
>
>
>  My OS is Windows 11 Pro 64-Bit, I have R 4.2.2 and RStudio installed.
>
>  If I double-click on a .R file in File Explorer the OS gives me the
>  option of opening the .R in RStudio, or Look for an app in the 
>Microsoft
>  Store, or More Apps. Similarly with a right-click.
>
>  I would like to associate a .R file with the RGui, not RStudio, thus
>  when I double-click on a .R file in File Explorer the .R file opens in
>  the R Editor in RGui.
>
>  On my PC R 4.2.2 is located in "C:/Program Files/R/R-4.2.2/etc"
>
>  Please can someone provide step-by-step instructions on how to
>  associate?
>
>
>  thanks,
>  Amarjit
>
>  [[alternative HTML version deleted]]
>
>  __
>  R-help@r-project.org <mailto:R-help@r-project.org>  mailing list -- To 
>UNSUBSCRIBE and more, see
>  https://stat.ethz.ch/mailman/listinfo/r-help 
><https://stat.ethz.ch/mailman/listinfo/r-help>
>  PLEASE do read the posting guide 
>http://www.R-project.org/posting-guide.html 
><http://www.R-project.org/posting-guide.html>
>  and provide commented, minimal, self-contained, reproducible code.
>
>
>
>
>   [[alternative HTML version deleted]]
>
>__
>R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>https://stat.ethz.ch/mailman/listinfo/r-help
>PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
>and provide commented, minimal, self-contained, reproducible code.

-- 
Sent from my phone. Please excuse my brevity.

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Associate a .R file with the RGui

2022-11-05 Thread Amarjit Chandhial via R-help




Hi Andrew/Petr,


Thanks for the replies.

In R Console if I run:

R.home("bin")

I get the following

"C:/PROGRA~1/R/R-42~1.2/bin/x64"

which is where

Rgui.exe is (within the x64 folder there are 13 files in total: 8 . exe 
and 5 .dll).


In file Explorer if I right-click on a .R file -> Open With -> R for 
Windows GUI Front-End

RGui (64-bit) opens but the .R file does not appear in the editor.


Amarjit


-- Original Message --
From: "Andrew Simmons" 
To: "Amarjit Chandhial" 
Cc: "R-help Mailing List" 
Sent: Friday, 4 Nov, 2022 At 09:08
Subject: Re: [R] Associate a .R file with the RGui

In an R session, run this:

writeLines(normalizePath(R.home("bin")))


Right click your .R file > Open with > Choose another app > Check the 
box "Always use this app to open .R files" > Look for another app on 
this PC
Paste the directory found above, then select "Rgui.exe"


On Fri, Nov 4, 2022, 04:49 Amarjit Chandhial via R-help 
mailto:r-help@r-project.org> > wrote:

  Hi,


  My OS is Windows 11 Pro 64-Bit, I have R 4.2.2 and RStudio installed.

  If I double-click on a .R file in File Explorer the OS gives me the
  option of opening the .R in RStudio, or Look for an app in the 
Microsoft
  Store, or More Apps. Similarly with a right-click.

  I would like to associate a .R file with the RGui, not RStudio, thus
  when I double-click on a .R file in File Explorer the .R file opens in
  the R Editor in RGui.

  On my PC R 4.2.2 is located in "C:/Program Files/R/R-4.2.2/etc"

  Please can someone provide step-by-step instructions on how to
  associate?


  thanks,
  Amarjit

  [[alternative HTML version deleted]]

  __
  R-help@r-project.org <mailto:R-help@r-project.org>  mailing list -- To 
UNSUBSCRIBE and more, see
  https://stat.ethz.ch/mailman/listinfo/r-help 
<https://stat.ethz.ch/mailman/listinfo/r-help>
  PLEASE do read the posting guide 
http://www.R-project.org/posting-guide.html 
<http://www.R-project.org/posting-guide.html>
  and provide commented, minimal, self-contained, reproducible code.




[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Associate a .R file with the RGui

2022-11-04 Thread PIKAL Petr
Hi 

another option is to use SendTo folder. This was easy to find in older
Windows versions. Now the easiest way is:

Press the Windows Key + R to trigger the Run window. At the Open field in
the window, type shell:SendTo and then click OK

And SendTo folder should open.

You can then add link to any application here so add RGui link

After that, rightclick on file .RData file and menu with option SendTo opens
with RGui one of the options.

I learned it before ages and it is quite usefull not only in this case.

Here is link to another explanation.

https://www.pcmag.com/how-to/how-to-customize-the-send-to-menu-in-windows

Cheers
Petr

> -Original Message-
> From: R-help  On Behalf Of Andrew Simmons
> Sent: Friday, November 4, 2022 10:09 AM
> To: Amarjit Chandhial 
> Cc: R-help Mailing List 
> Subject: Re: [R] Associate a .R file with the RGui
> 
> In an R session, run this:
> 
> writeLines(normalizePath(R.home("bin")))
> 
> Right click your .R file > Open with > Choose another app > Check the box
> "Always use this app to open .R files" > Look for another app on this PC
Paste
> the directory found above, then select "Rgui.exe"
> 
> On Fri, Nov 4, 2022, 04:49 Amarjit Chandhial via R-help < r-help@r-
> project.org> wrote:
> 
> >
> > Hi,
> >
> >
> > My OS is Windows 11 Pro 64-Bit, I have R 4.2.2 and RStudio installed.
> >
> > If I double-click on a .R file in File Explorer the OS gives me the
> > option of opening the .R in RStudio, or Look for an app in the
> > Microsoft Store, or More Apps. Similarly with a right-click.
> >
> > I would like to associate a .R file with the RGui, not RStudio, thus
> > when I double-click on a .R file in File Explorer the .R file opens in
> > the R Editor in RGui.
> >
> > On my PC R 4.2.2 is located in "C:/Program Files/R/R-4.2.2/etc"
> >
> > Please can someone provide step-by-step instructions on how to
> > associate?
> >
> >
> > thanks,
> > Amarjit
> >
> > [[alternative HTML version deleted]]
> >
> > __
> > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide
> > http://www.R-project.org/posting-guide.html
> > and provide commented, minimal, self-contained, reproducible code.
> >
> 
>   [[alternative HTML version deleted]]
> 
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Associate a .R file with the RGui

2022-11-04 Thread Andrew Simmons
In an R session, run this:

writeLines(normalizePath(R.home("bin")))

Right click your .R file > Open with > Choose another app > Check the box
"Always use this app to open .R files" > Look for another app on this PC
Paste the directory found above, then select "Rgui.exe"

On Fri, Nov 4, 2022, 04:49 Amarjit Chandhial via R-help <
r-help@r-project.org> wrote:

>
> Hi,
>
>
> My OS is Windows 11 Pro 64-Bit, I have R 4.2.2 and RStudio installed.
>
> If I double-click on a .R file in File Explorer the OS gives me the
> option of opening the .R in RStudio, or Look for an app in the Microsoft
> Store, or More Apps. Similarly with a right-click.
>
> I would like to associate a .R file with the RGui, not RStudio, thus
> when I double-click on a .R file in File Explorer the .R file opens in
> the R Editor in RGui.
>
> On my PC R 4.2.2 is located in "C:/Program Files/R/R-4.2.2/etc"
>
> Please can someone provide step-by-step instructions on how to
> associate?
>
>
> thanks,
> Amarjit
>
> [[alternative HTML version deleted]]
>
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Associate a .R file with the RGui

2022-11-04 Thread Amarjit Chandhial via R-help


Hi,


My OS is Windows 11 Pro 64-Bit, I have R 4.2.2 and RStudio installed.

If I double-click on a .R file in File Explorer the OS gives me the 
option of opening the .R in RStudio, or Look for an app in the Microsoft 
Store, or More Apps. Similarly with a right-click.

I would like to associate a .R file with the RGui, not RStudio, thus 
when I double-click on a .R file in File Explorer the .R file opens in 
the R Editor in RGui.

On my PC R 4.2.2 is located in "C:/Program Files/R/R-4.2.2/etc"

Please can someone provide step-by-step instructions on how to 
associate?


thanks,
Amarjit

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.