Error when executing R script from Command prompt - r

I am trying to run R script that works fine when running in Rstudio in command prompt, the reason why is that later I want to run it in Talend ETL tool.
However when I run it in command I obtain the following error:
Error in contrib.url(repos, "source") :
trying to use CRAN without setting a mirror
Calls: install.packages -> contrib.url
Execution halted
Any idea how to solve that?
Note: I tried to install the packages contrib.url or contriburl but it is not compatible with my version of R.
Thanks.

Related

Unable to Install R packages in Visual Studio Code

I wanted to use R in visual studio code and so I tried running some basic codes and it worked. But whenever I try to install any package (eg. ggplot2) from the R-Extension in the VsCode I get this error
Installing package into 'C:/Users/krish/Documents/R/win-library/4.1'
(as 'lib' is unspecified) Warning in install.packages(c("ggplot2"),
repos = "https://cran.r-project.org/") : 'lib =
"C:/Users/krish/Documents/R/win-library/4.1"' is not writable Error in
install.packages(c("ggplot2"), repos = "https://cran.r-project.org/")
: unable to install packages Execution halted The terminal process
"C:\Program Files\R\R-4.1.2\bin\R.exe '--silent', '--slave', '-e',
'install.packages(c('ggplot2'),repos='https://cran.r-project.org/')'"
terminated with exit code: 1.
Terminal will be reused by tasks, press any key to close it.
I have added r-library and r bin to env path following some other posts but it is not working.

Unable to start R serve on Windows VSC

I have installed the following extensions to VSC running on Windows: R, R Debugger, and R Tools. Nevertheless, when R server tries to start, I get this error message: Error in loadNamespace(x) : there is no package called 'languageserver'.
I haven't found how to get and install such package. Thanks for your help.
languageserver is a regular R package. Install it from CRAN with install.packages("languageserver"), like with any other package.

install_keras() Error: Keras installation failed (no conda binary found)

I am facing error in this command though I have python3 x in my system and have anaconda as well. I tried all the option given in
Error: Unable to find conda binary. Is Anaconda installed? reticulate Rstudio
https://stackoverflow.com/posts/53434444/revisions, but nothing working for me.
In fact, I am getting error for H2o as well.
Warning in install.packages :
unable to move temporary installation ‘C:\Users\kumaashi\Documents\R\win-library\3.5\file124f052421e1\h2o’ to ‘C:\Users\kumaashi\Documents\R\win-library\3.5\h2o’
I got this error earlier also but used to get fixed with trace(utils:::unpackPkgZip, edit=TRUE) by changing sys.time - 2.5 but since i updated R that option is not coming at all

Error in library ("dtw") : there is no package called "dtw"

I am trying to run an R script from the Windows Command Prompt but is running into the following error:
Error in library("dtw") : there is no package called 'dtw'
Execution halted
The code that I typed is just RScript ...R
The R script actually runs in RStudio, and the address returned from .libPaths() function contains the "dtw" package.
Anyone has any idea on how to fix this?

Why do I get a syntax error in devtools::install_github?

I am new in working with linux. I am trying to analyse sequencing data using dropEst pipeline https://github.com/hms-dbmi/dropEst#dropreport. I want to run the DropReport and for that I need to install dropEstR package.
I tried by :
devtools::install_github('hms-dbmi/dropEst/dropestr' , dependencies = T)
as they suggest and I get as an error:
bash: syntax error near unexpected token
`'hms-dbmi/dropEst/dropestr','
Do you have any idea what should I do differently?
I think you are using the "wrong" shell. You have to use R/RStudio, when you want to use the devtools package. From CRAN:
Title Tools to Make Developing R Packages Easier
I just tried you command in RStudio but installation fails in the end:
ERROR: dependency 'Rcpp' is not available for package 'dropestr'
* removing 'C:/R/R-3.4.2/library/dropestr'
Installation failed: Command failed (1)
You have to run such script on RStudio for R. Import your project here and run it.
You can download it from enter link description here
Happy Coding.

Resources