not recognized as an internal or external command, operable program or batch file. gcloud invocation failed - r

I just installed the google cloud package on R (cloudml). When I submit a job to the cloud I get this error message:
Error: ERROR: gcloud invocation failed [exit status 1]
[command]
cmd /c C:\Users\vidar\AppData\Local\Google\Cloud SDK\google-cloud-sdk\bin\gsutil.cmd ls -p
[output]
[errmsg]
'C:\Users\vidar\AppData\Local\Google\Cloud' is not recognized as an internal or external command,
operable program or batch file.
Installing the cloudml package in R took care of installing Google SDK and I didn't get any error message or anything during the installation process.
Any idea why I get this error message?

You are getting an error in this command:
cmd /c C:\Users\vidar\AppData\Local\Google\Cloud SDK\google-cloud-sdk\bin\gsutil.cmd ls -p
because it includes a space in the path (in Cloud SDK). From this answer in an older question:
You have to add quotation marks around each path and also enclose the
whole command in quotation marks
In your case:
cmd /c ""C:\Users\vidar\AppData\Local\Google\Cloud SDK\google-cloud-sdk\bin\gsutil.cmd" "ls -p""

Please run following command to resolve the error
gcloud_init()
refer to article for details
rstudio with cloudml on GCP
Packages should be installed in following manner
install.packages("cloudml")
library(cloudml)
gcloud_install() # install the SDK using the
gcloud_init() # default account, project, or region you can use the gcloud_init() function

Related

How to fix 'Unable to install packages' error while trying to run R script through command line?

I am trying to run an R script through the command line. My R script contains statement for inclusion of library and some methods of the same library as given here. The command line statement I am using to run the code is as below.
Test.R
library("readxl")
sales <- read_xlsx("<file path>", sheet = 1)
Commands:
cd "C:\Users\Debasish.sena\Desktop\out"
"C:\Program Files\R\R-3.2.2\bin\x64\Rscript.exe" -e "install.packages('readxl', repos = 'https://cran.us.r-project.org')"
"C:\Program Files\R\R-3.2.2\bin\x64\R.exe" CMD BATCH "C:\Users\Debasish.sena\Documents\Test.R" "C:\Users\Debasish.sena\Desktop\out\Test.Rout"
While executing the command I am getting the error as below:
Warning in install.packages("readxl", repos = "https://cran.us.r-project.org") :
'lib = "C:/Program Files/R/R-3.2.2/library"' is not writable
Error in install.packages("readxl", repos = "https://cran.us.r-project.org") :
unable to install packages
Execution halted
I am expecting the R script to be executed and the results stored in 'sales' variable
I think you are not logged in as Administrator, or you are trying to install on a remote system. Can you print the result of .libPaths()?
I had encountered a similar issue, I solved it as follows:
I created an Environment variable called R_LIBS for my account (NOT System variable) as R_LIBS=C:\Users\W.Aftab\Documents\R\win-library\4.0
Then I restarted the VS code as I was using its terminal to call Rscript.exe. you can restart the command prompt if you are using it to call Rscript.
That's it,
I tested it on 64-bit windows 10 enterprise.

shell command in R: C:\Program' is not recognized as an internal or external command

I'm trying to call cmd command from r via shell command:
shell('"C:\\Program Files (x86)\\folder\\anotherfolder\\program.exe" -i "C:\\Users\\username\\.ssh\\id_rsa.pub.ppk" C:\\TEMP\\test.csv user#domain://home//blt//tttttt//test.csv')
But getting "C:\Program' is not recognized as an internal or external command,
operable program or batch file"
Does anybody know how to fix this issue? Thanks for any of your hints.

Permissions-error using bash-script to install a library in R

I am running a software called CNV-Seq in a Bash script but, I do not have permission to run the following command:
R CMD INSTALL cnv/
The error is
* installing to library '/share/apps/r/3.2.2/intel/lib64/R/library'
Error: ERROR: no permission to install to directory '/share/apps/r/3.2.2/intel/lib64/R/library'
How can I solve this problem without gaining permission.
One approach is creating the bash script that executes R script.
So, the R script will contain:
install.packages("package_name")
Save it as xyz.r
and the bash script will contain:
R -f path_to/xyz.r
Save that as abc.
Run the bash script like this:
bash abc

Error in browser: The application unexpectedly exited. Diagnostic information has been dumped to JavaScript error console while using shiny-server

I'm trying to deploy a shiny web app on shiny-server. But everytime it gives the error :
"The application unexpectedly exited. Diagnostic information has been dumped to JavaScript error console"
The error shown in the error console is as follows:
"Listening on http://127.0.0.1:58865
Error in library(htmlwidgets) : there is no package called ‘htmlwidgets’".
I have installed the package 'htmlwidgets' on my machine. Still it always shows the error. the application works file in Rstudio but it is giving this error on browser when I run it on Shiny-server. Please suggest a solution.
Thanks.
Please read http://rstudio.github.io/shiny-server/latest/#run_as In particular, please note this:
For one, the paths in which R will look for packages (.libPaths()) are often user-dependent.
One way to solve the problem is, just like how you installed shiny, you may also install htmlwidgets to system-wide library paths, e.g.
sudo su - \
-c "R -e \"install.packages('htmlwidgets', repos='http://cran.rstudio.com/')\""

Brackets shell not running node commands

I have just installed the Brackets Shell extension (Mac OSX 10.9) and can run normal shell commands (ls, pwd), but not node commands (bower install, npm install). I get 'command not found'. Any suggestions?
Currently the brackets shell extension has a bug in that it is not reading your profile path environment. This is why you are receiving "command not found" in the console.
I'll be releasing an update to the shell extension this coming weekend (10/4/2014) which should resolve your issues.

Resources