Can't open R files

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Can't open R files

R help mailing list-2
Hello.  I'm not sure whether this is strictly the right forum but here goes...   I have got a new (well reconditioned) laptop and have installed R studio on it.  That works fine if I say write a little prog directly into it or paste R script from a word doc.  But if I try to open an R prog (which I've written elsewhere, the laptop doesn't recognise it as an R prog.  Instead it gives me a little icon with a pair of binoculars and says to try to find an app for opening said file.

But up to now I can't find anything on the net which will open the R files in the same way as they simply do on my desktop or old laptop.

I'd be grateful for any ideas or pointers

Thanks

Nick Wray
        [[alternative HTML version deleted]]

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: Can't open R files

Duncan Murdoch-2
On 21/05/2018 7:20 AM, Nick Wray via R-help wrote:
> Hello.  I'm not sure whether this is strictly the right forum but here goes...   I have got a new (well reconditioned) laptop and have installed R studio on it.  That works fine if I say write a little prog directly into it or paste R script from a word doc.  But if I try to open an R prog (which I've written elsewhere, the laptop doesn't recognise it as an R prog.  Instead it gives me a little icon with a pair of binoculars and says to try to find an app for opening said file.
>
> But up to now I can't find anything on the net which will open the R files in the same way as they simply do on my desktop or old laptop.
>
> I'd be grateful for any ideas or pointers

If you open RStudio, and use the File | Open File... menu, will it open
the program?

If so, then the problem is with your file associations.  If you're using
Windows, you need to right click on the file, choose "Open with...",
then pick RStudio and check the box saying you want to open all files
that way.

Duncan Murdoch

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: Can't open R files

R help mailing list-2
Oh fab it works! thanks v much i'd never used open file like that before Nick

> On 21 May 2018 at 12:24 Duncan Murdoch <[hidden email]> wrote:
>
>
> On 21/05/2018 7:20 AM, Nick Wray via R-help wrote:
> > Hello. I'm not sure whether this is strictly the right forum but here goes... I have got a new (well reconditioned) laptop and have installed R studio on it. That works fine if I say write a little prog directly into it or paste R script from a word doc. But if I try to open an R prog (which I've written elsewhere, the laptop doesn't recognise it as an R prog. Instead it gives me a little icon with a pair of binoculars and says to try to find an app for opening said file.
> >
> > But up to now I can't find anything on the net which will open the R files in the same way as they simply do on my desktop or old laptop.
> >
> > I'd be grateful for any ideas or pointers
>
> If you open RStudio, and use the File | Open File... menu, will it open
> the program?
>
> If so, then the problem is with your file associations. If you're using
> Windows, you need to right click on the file, choose "Open with...",
> then pick RStudio and check the box saying you want to open all files
> that way.
>
> Duncan Murdoch

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: Can't open R files

Boris Steipe
Just for completeness: there are several ways to open files for editing in RStudio -

 * Configure your computer to be able to double-click on a file and open it
   in RStudio: this is OS dependent. Google for "change file associations"
   to get advice.

 * Drag and drop a file icon onto the RStudio icon.

 * When RStudio is running,
   -  use the File -> open dialogue like Duncan said;
   -  if you have worked with the file recently, use the File -> Recent files ...
      dialogue;
   -  if the file is in your "working directory", it appears in the
      "file pane" of the RStudio window (bottom right). Click on the name.
      If it's not in the working directory, navigate the file pane by
      clicking on the ".." to go to a parent folder, or on a folder name
      to descend into the folder;

  *  On the command line, execute file.edit("<filename>"). You can also put
     this command into a script that you source(). (But not in the .RProfile
     script.)

  *  Programmatically, you can readLines() a file, add and change contents
     and writeLines() the result.

Cheers,
B.




> On 2018-05-21, at 07:31, Nick Wray via R-help <[hidden email]> wrote:
>
> Oh fab it works! thanks v much i'd never used open file like that before Nick
>
>> On 21 May 2018 at 12:24 Duncan Murdoch <[hidden email]> wrote:
>>
>>
>> On 21/05/2018 7:20 AM, Nick Wray via R-help wrote:
>>> Hello. I'm not sure whether this is strictly the right forum but here goes... I have got a new (well reconditioned) laptop and have installed R studio on it. That works fine if I say write a little prog directly into it or paste R script from a word doc. But if I try to open an R prog (which I've written elsewhere, the laptop doesn't recognise it as an R prog. Instead it gives me a little icon with a pair of binoculars and says to try to find an app for opening said file.
>>>
>>> But up to now I can't find anything on the net which will open the R files in the same way as they simply do on my desktop or old laptop.
>>>
>>> I'd be grateful for any ideas or pointers
>>
>> If you open RStudio, and use the File | Open File... menu, will it open
>> the program?
>>
>> If so, then the problem is with your file associations. If you're using
>> Windows, you need to right click on the file, choose "Open with...",
>> then pick RStudio and check the box saying you want to open all files
>> that way.
>>
>> Duncan Murdoch
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> [hidden email] 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.

______________________________________________
[hidden email] 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.