When I was trying to install TensorFlow, I keep on receiving this error, even though I updated R, Rstudio & R Packages. I was following this procedure in the link https://tensorflow.rstudio.co.
Unable to install package in R Studio- Unable to translateto native encoding. I am unable to install the package from my R Studio. Not sure what's the meaning. #' #' Alternatively, you can provide the full URL to an installer binary (e.g. #' for a nightly binary). #' #' @param envname Name of Python environment to install within #' #' @param extrapackages Additional Python packages to install along with #' TensorFlow. #' #' @param restartsession Restart R session after installing (note this will.
We are going to use Rattle for the first few weeks of the course and then switch to RStudio. There are two ways to install Rattle and RStudio. The first way is installing RStudio and then Rattle inside of the RStudio platform. The second way is installing R and Rattle separately and then installing RStudio later on.
In this document, we describe the procedures for doing it with Rstudio first. To do it without Rstudio, just type the commands directly into the R interface. See the Rattle book, DMRR, for more details.
(1) R Studio Installation Guide
Find the right version of an installer for RStudio for your platform here and download it. Once it is downloaded, run the installer and the installation process will start shortly.
For more information about RStudio, please visit https://www.rstudio.com/products/rstudio/download/
The suggested video for the first week also shows how to install Rattle.
(2) Rattle Installation Guide
- Open RStudio and enter the following command at the prompt (the lower left-hand corner of the screenshot below).
- install.packages(“rattle”)
Enter the following two commands at the R prompt. This loads the Rattle package into the library and then starts up Rattle.
- library(rattle)
To run the Rattle GUI on RStudio, type the following command:
- rattle()
If a separate Rattle GUI pops up, you are set to go!
This should be enough on Windows systems.
(3) How to solve the dependency problems (Rattle needs RGtk2, XML, and CarioDevice)
TL;DR
Rattle will install other packages as needed but we can force the install of all other packages Rattle uses in one go if we so wish, using:
- install.packages(“rattle”, dep=c(“Suggests”))
R Studio Unable To Locate Binary After Installing
A longer explanation
If the RGtk2 package has yet to be installed, there will be an error popup indicating that libatk-1.0-0.dll is missing from your computer. Click on the OK and then you will be asked if you would like to install GTK+. Click OK to do so. This then downloads and installs the appropriate GTK+ libraries for your computer. After this has finished, exit from R and restart it, so that it can find the newly installed libraries.
When running Rattle a number of other packages will be downloaded and installed as needed, with Rattle asking for the user’s permission before doing so. They only need to be downloaded just the once.
The installation has been tested [140720] to work on Microsoft Windows, 32bit and 64bit, XP, Vista and 7 with R 3.1.1, Rattle 3.1.0 and RGtk2 2.20.31.
Similarly for XML and CarioDevice packages, click on the OK when you are asked if you would like to install the packages.
(4) Optional for Windows
R Studio Unable To Locate Binary After Installation
To use the Microsoft Windows theme engine, and thus have Rattle look like all other Windows applications (in terms of colour and style), create a file with the name gtkrc to contain the following line. Make sure the file name does not have any filename extension (i.e., no .txt or anything else with a dot). The file needs to be located in the GTK+ installation folder. This might be, for example, C:/Users/username/R/win-library/2.15/RGtk2/gtk/i386/etc/gtk-2.0/.
gtk-theme-name = “MS-Windows”
(5) Installing Rattle on a Mac
Former student Yicong Li figured out some very useful information. In the past, many Mac owners have had trouble installing Rattle. Here is what she learned, after considerable research. Also: It is worth repeating the regular Rattle install several times. The basic problem is that some additional libraries must be installed in order for Rattle to run. These libraries seem to install only gradually.
These instructions are from April 2017. They may need updating. Please give comments on this message, or mail them to the TA, Feiyang.Chen@rady.ucsd.edu, if you run into additional installation problems. Also, respond if you have suggestions that might be helpful.
Hi Roger,
Just want to update with you that I think I found a solution for installing rattle packages.
Problem: run >library(rattle) and get >error on install GTK+
Solution: Second answer from this site: http://stackoverflow.com/questions/36042749/error-installing-rattle-package-in-mac
Note: No need re-install R or Rstudio, just install XQuartz and GTK+ from links provided.
Then run >install.packages(“rattle”, repos=”http://rattle.togaware.com“, type=”source”)
>library(rattle)
>rattle()
It works on my Mac now. Hope it can help others that having the same problem.
Here is what I did on another machine and it worked.
Install XQuartz from this link.
Run:
>install.packages(“rattle”, dependencies = T)
This will work.
The Linux operating system is a great platform for computing. However, it takes some efforts for users who migrate from other operating systems (e.g., Windows) to get started. For example, when I migrated to Linux, I spent quite some time trying to understand how to install the latest version of R on the system. For those of you who are in the same situation like I was, I am writing this tutorial to help. In this tutorial, I will not only show you how it’s done, but will also inform you why each step is necessary, so that you can get a better understanding.
This tutorial is based on Ubuntu, which is perhaps the most popular Linux distribution. Before diving in, here’s something you need to know: (1) most Linux distributions including Ubuntu include a program called bash
that runs various kinds of commands such as those for software/package management, e.g., apt
; (2) you should not confuse package installation using the apt install
command in a bash session (which can be invoked by pressing CTRL+ALT+T
) and that using the install.packages()
function in an R session (which can be invoked by entering R
in a bash session).
You can install the r-base
package, which includes the essential components of R, using the apt install
command. By default, the command will search and install the components from a repository called Universe. However, the version of R included in this repository is typically not up-to-date. Alternatively, you can tell apt install
to obtain the latest version from a CRAN repository. This can be achieved by first adding the following entry in your /etc/apt/sources.list
file in a new line (you can run a text editor as root, e.g., sudo nano /etc/apt/sources.list
, to add the entry):
Note that you should replace <my.favorite.cran.mirror>
with one of the urls provided by this site; replace <code-name-adjective>
with your Ubuntu release code name adjective (see here for a full list). For example, to obtain the latest R 4.0 packages, add an entry like
or
or
After adding the entry, you will also need to add a key to your system so that apt
can perform signature checking of the Release File for the added repository to verify its authenticity. The CRAN repository for Ubuntu is signed with the key of “Michael Rutter [email protected]” (see https://cran.r-project.org/bin/linux/ubuntu/README.html). To add the key, enter the following command in bash:
Now that the setup is done, you can install the latest version of R (remember to first update package index files from the repository):
Now, you should be able to open R by entering R
in bash.
After the installation of the core packages, you would typically want to install additional R packages using the install.packages()
function in R. However, the function depends on the r-base-dev
package to compile source code for some R packages. Therefore, prior to using the install.packages()
function, you should first install the r-base-dev
package. Like r-base
, the r-base-dev
package can be installed in a bash session:
R Studio Unable To Locate Binary After Installer
Now, you should be able to install most R packages using the install.packages()
function in R.
You are perhaps aware that, when you install an R package that depends on other uninstalled R package(s), the install.packges()
function will automatically install all the required packages at once, even if you don’t explicitly tell it to.
However, things are different when you install an R package that depends on other uninstalled non-R package(s). Under this circumstance, you will always need to manually install the required package(s) before you use the install.packages()
function.
A good example would be an R package called tidyverse
. In case you don’t know, the tidyverse
is a set of R packages (e.g., ggplot2
, dplyr
, …) developed for data science (e.g., data visualization, data manipulation, …) under a tidy and elegant design philosophy. You can visit the home page for more information.
In short, the tidyverse
package requires the following non-R packages: libcurl4-openssl-dev
, libssl-dev
, libxml2-dev
. Like r-base
and r-base-dev
, you can install them in bash:
Now, you should be able to install tidyverse
in R using the install.packages()
function:
If you are looking for an integrated development environment (IDE) for R, I recommend Rstudio. The installation of Rstudio is simple and straightforward. First, download an installer for your system from here. Second, double-click the installer (the installer for Ubuntu should have a file extension “.deb”) and follow the instructions. The whole process is very straightforward so I am not going into the details here.
If you need to use R on a remote Linux server, you’ll probably need RStudio Server as well. Briefly speaking, RStudio Server provides a browser based interface to R running on a remote Linux server. To use RStudio Server, you’ll need to following steps on the remote server.
First of all, since RStudio Server by default does not allows system users (such as root) to authenticate, you need a normal user account with sudo privilege1 on the server. The following code shows how to create one:
Second, install gdebi2 and RStudio Server (you can find <deb_package_url>
from here):
If you installed RStudio using a package manager binary (e.g. a Debian package or RPM) then RStudio is automatically registred as a deamon which starts along with the rest of the system. However, if you need to manually stop, start, and restart the serve, here’s how:
There are a number of administrative commands which allow you to see what sessions are active and request suspension of running sessions (note that session data is not lost during a suspend):
After the above steps, you should be able to access RStudio Server through the web browser of your local machine. To do so, just enter the ip address (including port number; by default, RStudio Server listens on port 8787) of your remote machine.
In this post, I demonstrated and explained the process of installing R, as well as relevant components on Ubuntu. Once you are familiar with the concepts, you should be able to install additional R packages with more ease.
The sudo privilege is needed because you need to install various packages.↩
This package handles the installation of RStudio and its dependencies on Debian/Ubuntu.↩