I apologize, the way I wrote that was unclear! The outside quotes are important to include in this case. So what you enter into PS should be this, including all quotes: "C:\Program Files\R\R-4.1.0\bin\Rscript.exe" -e "tempdir()"

Were you able to check if you have access to C:\Users\{your-user-name}\AppData\Local\Temp?

how to check this access

I apologize for not explaining that. Can you navigate to that folder path in file explorer? If so, can you create a new file of any kind in that folder?

Yep I can create new folder in Temp

Well, that's bothersome. What's your output of this in PowerShell?

gci env: | Where-Object { $_.Name -like 'T*MP' }

here it is

Thanks! That TEMP variable looks like a bad path (No slash after the C:). Could you run this in PS and try launching RStudio again?

$env:TEMP = $env:TMP

This will set both variables to the value of TMP, which looks more like a working path.

the same as fatal error

Okay, could you try restarting, run gci env: | Where-Object { $_.Name -like 'T*MP' } to verify that TEMP and TMP are the same, and then launch R? I'll try to think what else might be going on in the meantime.

error again in R

Okay, I did find this thread, which suggests it may be related to insufficient memory:

So you could try setting your TMPDIR variable to something new, like ~/Documents/Temp and then maybe it would work?

how to do it create new variable?

First, create the directory you want to use, for example ~/Documents/Temp. Then run $env:TMPDIR = "~/Documents/Temp". After that, try running R (You may need to restart your machine first)

Also, it might be safer to not rely on tilde-expansion, I don't know too much about it. So you could instead run $env:TMPDIR = "C:\Users\ASUS\Documents\Temp". That's probably safer.

it was show fatal error again

Well, I'm out of ideas, and I think I've searched all my channels I can think of. That last link I posted has several different solutions in it, so you could try other ones from there? You could also Google the error you're getting with quotes around it. That will give you results from other people searching that exact error.

1 Like

it's ok thx for help me about this problem I am gonna use R coding online .
I am so glad the you help as much as you can .thank you

Hey now I can run R
how to solve?:
I download Microsoft R open and it can run on my notebook omg

Well, that's wonderful! Thanks for following up with the solution, hopefully this will help others with the same problem. Happy coding! :grinning_face_with_smiling_eyes:

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.