Rtools not working in command prompt - r

First off, I'm unfortunately a windows user. So downloading Rtools and being able to use it from the command prompt is a bit of a pain. However, I figured it out. And everything worked fine. Just recently, however, I have not been able to run R from the command prompt using the R command. This did work at one point. However, now when I execute the command R in the command prompt R opens but when I type some R code (q(), matrix(1:4,2,2), etc...) and hit enter nothing happens. This is very bizarre. Has anyone else experienced this? Does anyone know what is wrong?
One last thing. I have tested the following R CMDs, INSTALL, SHLIB, build, check. They all work fine.
Thanks in advance!

Related

Rstudio - cannot save files or open Rscripts 'The system cannot find the path specified'

Error when saving Rscripts
Error when opening Rscripts
Hi guys,
Have been stuck on this problem for the past year or so and would really appreciate any help. I am unable to save any Rscripts in Rstudio, as I keep getting the first error above. The one exception is, when running Rstudio with administrative permissions, - when saving into C:/Users, which is apparently the default working directory. I am also able to open Rscripts from C:/Users, but not from anywhere else. When I change my working directory using setwd(), Rstudio accepts the change but I am unable to save or open files in the new directory (or anywhere else).
I have tried fully uninstalling and reinstalling Rstudio and R, as well as adding the folder R and Rstudio are in, and my desired working directory folder into the 'PATH' variable in windows (through 'edit the system environmental variables'). But nothing seems to be working. Have also searched online pretty extensively but haven't managed to find a working solution so far.
I am using the latest 2021.09.1 Build 372 of Rstudio, and R 4.0.4. However, I have also faced the same problem on the last few versions of Rstudio and R over the past year as I have tried to update hoping that it would fix the problem but to no avail. I downloaded R and Rstudio from CRAN and the Rstudio website respectively.
Thanks a lot!
This exact thing happened to me. It turned out for me that when I updated my Window's environment variables, I added an extra slash for my HOME variable. This screwed things up with RStudio.
Search for "Edit the system environment variables" after pressing the Windows button and edit the HOME variable to make sure there is no trailing slash.
Good
C:\Users\leune006
Bad
C:\Users\leune006\
I hope that helps you and whoever else comes across this frustrating "bug"!

RStudio Freezing

I have tried redownloading R and RStudio. I've also tried downloading it from Microsoft Edge and Google Chrome. When I run RStudio. It completely freezes and I cannot write edit anything and I also cannot close out RStudio without doing Ctrl+Alt+Delete to Task Manager to end task.
R (standalone) R x64 4.0.3 runs perfectly fine.
Does anyone else have this issue currently? This just started recently.
EDIT: I found a solution where if I open up a separate RStudio window while the one that is frozen is still present, and then CTRL+ALT+DELETE to remove the other window. Then it runs. Although, I would like to find a better solution in the future.
After 10 min the original frozen version works
Figured it out. If you delete a file that is found in the tab of RStudio. You need to wait 5-10 min until it unfreezes and then delete those tabs from RStudio.

Why do I get error messages when trying to save or exit from Rstudio?

I deal with a problem in R Studio. When I choose to save my work, this message shows up
And if I try to close the program, this message shows up
Any ideas why this happens? Also, I would like to ask if it is better to use the latest version of R (R4.0.2)?
Thank you for your answers. The problem was that I had open an R script file which I had deleted before. When I remove this script, Rstudio works fine.

Getting output and full command history for R when using the Windows Command Prompt

I am a professor at a small college, and I am working with a blind student in a statistics course. We have found that R is by far the most accessible system to use, and for the screen reader to work (i.e. for it to read the output), we need to run R out of the Command Prompt (the student uses a Windows machine, specifically one running Windows 7). Though using the R console would probably be easier to operate, for some reason the screen reader being used by the student (JAWS) doesn't read the output in the console.
We have gotten to the point where we can use R out of the Command Prompt just fine, but the issue is that we cannot save the command history and the output from the Command Prompt to an external file (e.g. a .txt). I understand that I can use the sink() function to get the output in a .txt file, and I can also use the savehistory() function to get the command history, but I need something that captures both. We have also tried to use CMD outside of the R environment to try and print the full session of the Command Prompt, but that doesn't seem to capture the work that we might do during an R session.
On a Mac, this wouldn't be a problem, but I am not the best with using the Windows Command Prompt.
Any help would be greatly appreciated, and if more detail is required, I am more than happy to provide it.

Running two instances of Rstudio simultaneously on Linux

I've got a lengthy process running in Rstudio and I would like to open a separate session of Rstudio while the first one is running. I know I can run R from the command line to get as many sessions as I want, but I wanted to know if it is possible for me to do this in Rstudio on a Linux computer. Thanks.
#infominer suggested a good solution, which is to simply type rstudio in the command line. That's what I ended up doing
Another convenient way to deal with this is to start a seperate R-instance in the terminal by typing simply
R
and from there just run the script that has a lengthy process with
source("path-to-your-script/your-script.R")
you can than continue to edit and work with your two scripts in the already opened R-Studio editor window.

Resources