How to check whether R is already installed in Ubuntu? [closed] - r

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
I am newbie to R and I think I previously installed R but not sure.
Is there any way to know whether R is installed in your system?

On ubuntu I would typically use the which command to check for existance of a program.
which is a Unix command used to identify the location of executables. If the R executable is somewhere in the PATH then it should return its location:
john#ubuntu:~$ which R
/usr/bin/R
Alternatively you can use the type command:
john#ubuntu:~$ type R
R is /usr/bin/R
type is a Unix command that describes how its arguments would be interpreted if used as command names.
failing R being on the PATH you could resort to locate which would be faster then find however it will most likely give you a large number of returns for R so some filtering would be required:
john#ubuntu:~$ locate -b R | fgrep -w R/bin
/usr/lib/R/bin/R
/usr/lib/R/bin/REMOVE
/usr/lib/R/bin/Rcmd
/usr/lib/R/bin/Rd2pdf
/usr/lib/R/bin/Rdconv
/usr/lib/R/bin/Rdiff
/usr/lib/R/bin/Rprof
/usr/lib/R/bin/Rscript
/usr/lib/R/bin/exec/R

Just to summarize a few answers from the comments with less snark...
typing R into the command line might bring it up. If that doesn't work, R is probably not installed.
R might be in /usr/bin/. Look in that folder. If not, there's an even slimmer chance that you have R.
Search for a file named R otherwise.

Related

Can I get emplacement of `sources.list` in cmd on a Modified UNIX? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 2 years ago.
Improve this question
i would like to know how can I get the path to sources.list on a modified UNIX which have apt and other base packages on it , like gpg and sudo. Does apt can identify the path to sources.list ?
He is using it , so he should be able to locate it, right ?
I don't know if this is the best way, but apt-config dump will show all of apt's configuration variables. On my system, the Dir::Etc variable gives the directory where the file is located, and Dir::Etc::sourcelist gives its name.
You can also read in the apt-config man page about the shell option which may be more useful for processing this data in a program.

How to install Rtools? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 2 years ago.
Improve this question
I need to install Rtools in order to work with keras package. I've successfully downloaded Rtools from https://cran.r-project.org/bin/windows/Rtools/, but then I need to "put it on a path", as it is stated here on this website. I don't understand what is written here about doing that. Could you,please, explain it to me in a simple way and, desirably, with an example?
Thank you for your help.
The path is the list of all directories the operating system is going to look to find a program when you call it.
An alternative instead of modifying the system path, is to create a file which tells R where to find RTools.
As stated in the installation doc, just open an R console and execute once:
writeLines('PATH="${RTOOLS40_HOME}\\usr\\bin;${PATH}"', con = "~/.Renviron")

What is the diffrernce between cd ./dirname vs cd dirname? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 4 years ago.
Improve this question
cd ./dirname and cd dirname both seem to take me to immediate subdirectory.
Is there any underlying difference apart form the syntax?
The former will work for directories with (a certain set of) "strange" names.
cd ./-P
cd ./~
There is no practical difference.
It is simply two alternate notations of a path. And since the cd command accepts a path as a runtime argument you can use both notations. But it does not make a difference in that situation.
This does make a difference in other situations. For example when trying to execute a file the ./ prefix forces the shell to look for the executable in the current directory, not in the environment PATH.
The command cd ./dirname explicitly say you want to go to the dirname directory in the current folder

How to install gdata in R? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
I am totally new for installing outer tools or libraries into R.
I want to use gdata tool in R, which is outer tools so needed to install.
From this page,
http://cran.r-project.org/web/packages/gdata/index.html
I downloaded windows binaries(because my PC is 64bit windows)
1)but I don't know how to install this in my PC after this.
inside gdata folder there are so many files but none of these are installation file! What should I do??? Nowhere can I find installation guide...
2)And how to call functions inside this file on R.
Could you please help me? Many Thanks!
install.packages("gdata")
require(gdata)
If that gives you any trouble try:
install.packages("master.tar.gz", type = "source", repos = NULL)
where "master.tar.gz" is the file you downloaded. Specify the path with double (escaped) backslashes if it is not in your working directory.
I wrote "Master" to correspond to source downloaded from GitHub (i.e. the "Master branch") but the name from CRAN will be different.

What Tool or System Can I Use To Run R code [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 8 years ago.
Improve this question
I need to mine some data from a PDF. For this, I have written some R code and saved it as My_Code.R) about 80-90 lines. What is the best tool or software that I can access in order to run 'R-code'.
Any help on this is appreciated. Thanks a lot in advance.
Thanks,
Chaitu
Option 1: RStudio
In terms of a general tool for running R code, have you tried RStudio: https://www.rstudio.com/
As they note on the site, the "RStudio IDE is a powerful and productive user interface for R. It’s free and open source, and works great on Windows, Mac, and Linux." I use RStudio, as well as other IDE's, including Eclipse, nearly every day at work. Here is a quick screenshot of RStudio in action:
Of course, to run RStudio, you will need to install R. You can get more information on R here: http://www.r-project.org/
Option 2: R Command Line
As an alternative, you could simply run your R script on the command line in R using the call:
source("filename.r") to run your code.
Option 3: Path Variable
Assuming that you changed your path variable, you could also run a source R file using the following call:
r -f filename.r
You might want to also consult a great resource here which gives lots of information about running R from the command line.
You can use RScript command to run (wait for it) an R script.
e.g.
On Windows
Rscript.exe My_Code.R
On Linux/Mac
Rscript My_Code.R
You need to make sure Rscript in available in your PATH variable.

Resources