system/system2 command in R - r

I'm using system command in R for invoking an OS command. The problem is that my OS command works only when I use it as administrator from the shell. How I can work from R as administrator?
Using simply system(command) access to files is denied. How I can solve? Thank you!!

I solved just clicking on R icon and runned it as adminstrator!

Related

How to get the r path in Chromebook for setup on vs code

I tried running a R program on my vs code installed on my Chromebook, but I can't do that, I keep getting the message to set up my r path. I should change it from r.rterm.linux to r path. I don't know where to find the path directory on Chromebook.
Please someone should help me out or give me an alternative to run a R program on Chromebook.
Open a terminal (Ctrl+Alt+T) and run this command:
which R
It should print your R path.

Problem with mismatched perl binaries using system2 command

I am trying to run an executable script from within RStudio. The script runs perfectly from Terminal, however, when trying to run it form within R I get the following error message:
setwd("/users/admin")
command <- "/users/admin/Test_script.command"
system2(command)
> lib/Bio/DB/HTS/Faidx.c: loadable library and perl binaries are mismatched (got handshake key 0xdb00080, needed 0xc500080)
I am running MacOS X Big Sur and I use perlbrew with perl version 5.26.2, I guess the problem is that RStudio tries to use my system perl version - but I couldn't find a way to change that…
Any ideas? Thanks!
I found a way to get it running by looking into the actual script, which is perl based. Then I was able to solve the problem by following the answer to https://stackoverflow.com/a/65553736/4253357 as Michal suggested. Thanks again for your help!

Premake5 will not run on Mac OS

enter image description here
I tried to run the premake5 file retrieved from https://premake.github.io/download.html
But bash gives me this. Not sure what is wrong...
Premake is a command line application; here is an article on what that means, and how to use the macOS Terminal application.

I cannot run my R script in Xcode for OS X mavericks

I'm using Xcode for OS X mavericks. I have written the code in R and saved it as a script file (.r). I can't run the script directly in R, only in Xcode. However, I'm not sure how to run the script I saved in R in Xcode. Could someone offer a simple explanation? thanks
In the R runtime environment, type the following command and execute it:
source(file.path(path, filename.saved.from.xcode.ending.in.r))

Can't call cygwin commands from R

I'm working in windows box, and using cygwin to imitate unix shell. Also I have R and want to run any system comand from it. I believe that system('command') would do this, but it didn't work for each 'command'. For example system('ls') returns /cygdrive/c/cygwin/bin/ls: write error: Bad file descriptor and I think that this is beacause R calls ls >& - which also returns same error. So how solve this problem?
I hope you are still interested in a solution. Here is what I have:
Start R from Windows and call cygwin executable by path: system('C:/cygwin/bin/ls.exe');
Start R from within cygwin:
Start cygwin
Set path: export PATH="$PATH:/cygdrive/c/Programme/R-2.9.2/bin"
Call R: Rgui.exe
Call shell: system('ls')
Regards,
Martin.

Resources