Installing R with the pkg installer doesn't require XQuartz. However, install R with Homebrew requires to install XQuartz first.
Can anybody explain why please?
Is there a way to install R without Xquartz with Homebrew?
I need to decide whether to use Homebrew, or install R, Python etc with their pkg installers before applying to multiple computers (running OS X 10.8).
If you look at the recipe you'll see you can pass --without-x11 as a parameter (which should remove the need to have XQuartz installed. There is a cask for xquartz, btw. There is a recipe for R GUI, as well.
Homebrew R has had some issues with RStudio in the past and is also not recommended by the R maintainers.
According to this commit on GitHub, it has been fixed.
r: fix build with Quartz-only cairo #2434
Now, XQuartz is not required anymore, tested and it works:
brew update
brew tap homebrew/science
brew install r
I found that R works just fine without x.11 until I wanted to use the simple text editor. It complained about not having x.11, and wanted xquartz. I installed xquartz from home-brew and RStudio (and R) worked just fine. Hope that's useful.
Related
I have installed Anaconda 3 for Mac M1 and I am trying to create a new environment for R. However, everytime I try to do this, I am faced with the below error:
Conda Prompt Error Message
I am faced with this error irrespective of whether I try to do this in anaconda navigator or conda prompt. I have already tried removing Anaconda completely and reinstalling it again but to no avail. Is there anything I can do here?
Update: As requested, here is an additional screenshot:
Mamba install r-eesentials
Mamba install r-essentials output
[Disclosure: I am a volunteer on the Conda Forge R team.]
Conda users who want to use R should prioritize Conda Forge. The Anaconda company has not actively maintained R packages since v3.6.
If installing Conda for the first time, I recommend Miniforge variants (specifically, Mambaforge), rather than the Anaconda distributions (which prioritize defaults/anaconda channel).
Also note that osx-arm64 support for R through Conda is currently sparse. We are actively working on migrating, but for simplicity of workflow, I still recommend Conda users to install a osx-64 version of Conda and use that platform when installing R. You can always create native osx-arm64 environments when you actually need them (e.g., native TensorFlow with Metal support).
I want to use ImageMagick in R, but R won't let me install it.
install.packages("ImageMagick")
Installing package into ‘C:/Users/FSFH-2/Documents/R/win-library/3.0’
(as ‘lib’ is unspecified)
Warning message:
package ‘ImageMagick’ is not available (for R version 3.0.1)
I'm under the impression that I have the latest version of R, so what's going on here?
Additionally, I downloaded ImageMagick into windows, but I can't figure out how to get it into R. Help!
you need to install a package named "installr" prior to installing ImageMagick.
Simple Steps:
Tools->InstallPackages->installr
From R command Line write
require(installr)
install.ImageMagick() (This command will by default install the latest version, u can specify the URl of the version needed)
The package will be installed !!!
There is now a package magick that wraps around the ImageMagick STL.
It can be installed simply with install.packages("magick")
There is a blog post explaining what you can do with it here: https://ropensci.org/blog/2016/08/23/z-magick-release
Just follow the link Link to download and install ImageMagick on Windows. After that, type your command (like convert ...) in cmd.exe to verify that ImageMagick does exist. At this time, I know that we can only use it in cmd.exe, not in R.
If you are on Mac, what just worked for me was to use Homebrew in Terminal (if you don't have homebrew or anything similar, get it!).
I installed ImageMagick, and then I had to install animation in R itself.
In terminal:
sudo brew install ImageMagick
... it installs a few package dependencies and finishes up.
In the R console afterwards (in R, Rstudio, Emacs, ...):
install.packages("animation")
Now try ?gganimate and run the examples at the bottom to test it out!
The examples in the help file worked without problem for me. This works within Rstudio very fluidly, Rstudio being written just as a web-browser is under the hood. I personally use ESS within Emacs, which for plotting usually opens an X11 (or Quartz) window. Using gg_animate, however, opens a browser by default and displays the output there.
I used these commands in RStudio.
install.packages('installr')
library(installr)
install.ImageMagick()
It installed the latest version of ImageMagick.
If you're using Mac OS or Linux, you can install ImageMagick on your system and then use it from within R using the system() function. I don't know if ImageMagick works with Windows.
If you are on Mac, what just worked for me was to use port in Terminal.
I installed ImageMagick, and then I had to install animation in R itself.
In terminal:
sudo port install ImageMagick
... it installs a few package dependencies and finishes up.
In the R studio afterwards:
install.packages("animation")
and then check by running following example:
saveGIF({
for (i in 1:10) plot(runif(10), ylim = 0:1)
})
if the above conversion was successful, the option 'convert' should not be NULL
I am trying to install two packages in R (3.3.2): devtools and git2r. They are depending on the existence of zlib. This comes with macOS Sierra (10.12.3) and it's version 1.2.8 by default.
When I'm trying to install these packages I get the error below.
I've been trying a lot of things.
directly installing via CRAN in RStudio: no effect.
trying to locate zlib on macOS: can't find zlib.
installing via R CMD INSTALL git2r: no effect.
I notice someone has a similar issue posted on GitHub: https://github.com/ropensci/git2r/issues. There is no solution yet.
Does anyone here have an idea?
Thanks!
Sander
ERROR MESSAGE BELOW
configure error in "/private/tmp/RtmpP6HZFx/R.INSTALLe73412909267/git2r"
configure error
The zlib library that is required to build git2r was not found.
Please install:
zlib1g-dev (package on e.g. Debian and Ubuntu)
zlib-devel (package on e.g. Fedora, CentOS and RHEL)
and try again.
If the zlib library is installed on your system but the git2r configuration is unable to find it, you can specify the include and lib path to zlib with:
"R CMD INSTALL --configure-args='--with-zlib-include=INCLUDE_PATH --with-zlib-lib=LIB_PATH' git2r"
See "config.log" for more details
ERROR: configuration failed for package "git2r"
*removing "/usr/local/lib/R/3.3/site-library/git2r"
UPDATE: the same issue persists on macOS X 10.12.5 in combination with R 3.4.0 - the latter I need for DESeq2.
Solution...Mmm. Not really. I simply uninstalled R and all the packages, and than I reinstalled everything again. I installed R and RStudio via homebrew, following the instructions here: https://rud.is/b/2015/10/22/installing-r-on-os-x-100-homebrew-edition/.
Oddly enough: all issues disappeared.
UPDATE #1: this solution does not - obviously - work for the combination R 3.4.0 and macOS X 10.12.5. We need a solution for this issue.
UPDATE #2: I have discovered what I believe was the issue: a wrong path to the xcode command line tools.
sudo xcode-select --reset did the trick and now xcode-select -p points to /Library/Developer/CommandLineTools. And which xcode-select points to /usr/bin/xcode-select. Googling I discovered that it is not needed to install Xcode through the App Store as it states on http://railsapps.github.io/xcode-command-line-tools.html:
"On earlier versions of macOS, it was more difficult to install Xcode Command Line Tools. It required a huge download of the full Xcode package from the Mac App Store or registration as an Apple developer for a smaller Command Line Tools package. Mac OS X Mavericks made installation of Xcode Command Line Tools much simpler.".
i was having the same problem. i have a note 8(samsung). just go to GitHub and install zlib from there.
new to Cygwin. I downloaded apg-cyg and have been using it to install packages.
Recently I installed R and the current version in Cygwin packages is R.3.2.4. I wanted to install the latest R package but couldn't find a way from googling on how to do it inside Cygwin.
Is this possible to do or I just have to wait for the Cygwin packages updating their packages to the latest version? It would be nice to be able to update a package using the source file inside Cygwin..
Edit:
I should mention that I tried to install ggplot2 inside R using install.packages() and there was non-zero exit status and the installation couldn't go through.
You can install the source using cygwin setup. Click on the mouse on the "Src?" column.
The source will be installed in /usr/src
PS: next R release 3.3.1 is in 11 days. It will be packed for cygwin if there are no build issue
Followup:
There were several build issues, it took longer than expected to build 3.3.1
https://www.cygwin.com/ml/cygwin-announce/2016-06/msg00056.html
After installing Mavericks on my Mac, I'm not able to run Rattle anymore.
Because of compatibility issues between RStudio and 10.9 (http://www.r-bloggers.com/rstudio-and-os-x-10-9-mavericks/), I installed v 0.98.433 of RStudio and R 3.0.2
Tried to launch Rattle the normal way: none.
I tried in a different way:
I manually launched xQuartz to install GTK+
via R-Studio I installed RGtg2 and Cairo
Installed Rattle, launched it and I got 1 sec message from Rattle, before it disappeared, crashing R session.
I then tried going back to R 2.15.3 (using RSwitch), doing same procedure.
Rattle starts with no ricognizable character and a bunch of related error messages on the RStudio console, from Pango.
Problem is it is looking for a directory .../pango/1.6.0 that does not exist (I have /1.8.0).
Is there any one who came out with a working combination of R/RStudio/Rattle on Mavericks?
I have a course I'm going to teach on data mining next semester and I introduced Rattle as the core tool, but I need it running.
Going back to previous Mac OS is not an option, because students may have the latest version.
Any help would be highly appreciated
I believe that the problem is with the GTK2 and Cairo modules. After building a few packages from source, rattle works for me...
I have had difficulties with Cairo/GTK2 since Mountain Lion. I got crashes using Simon's binary packages for these. Note that I updated my system to Mavericks, so I have not tried this on a clean install... I also have Homebrew installed for building programs from source. I use the ATT binary installer for R (thanks, Simon) for most packages but build a few packages from source. There were some hiccups and I spent a lot of time searching with Google. Here is what I did:
One needs XCode and the Xcode command line tools installed. After you install XCode, you need to run
sudo xcode-select --install
to install the command line tools. Then install Homebrew according to directions from the web site... Install gtk+ and cairo with their dependencies with:
brew install gtk+ cairo
And wait quite a while for everything to build....
The first problem I had is that I couldn't build any R packages from source because of this error:
make: llvm-gcc-4.2: No such file or directory
Google to the rescue...
I needed to change two lines in Makeconf in /Library/Frameworks/R.framework/Resources/etc to
CC=clang
CXX=clang++
Note: the R Mac Tools page now says this should be:
CC=/usr/local/clang4/bin/clang
CXX=/usr/local/clang4/bin/clang++
LDFLAGS=-L/usr/local/clang4/lib
Then download the source packages for RGtk2, Cairo, and cairoDevice. I do all the work in my ~/bld directory with:
cd ~/bld
export PKG_CONFIG_PATH=/opt/X11/lib/pkgconfig:/Library/Frameworks/GTK+.framework/Versions/Current/Resources/lib/pkgconfig:$PKG_CONFIG_PATH
R CMD install RGtk2_2.20.25.tar.gz
R CMD install Cairo_1.5-2.tar.gz
R CMD install cairoDevice_2.19.tar.gz
Hope this helps.