Note that retrieving the sources by e. The Subversion repository does not contain the current sources for the recommended packages, which can be obtained by rsync or downloaded from CRAN.
To use rsync to install the appropriate sources for the recommended packages, run. A suitable incantation from the top level of the R sources using wget might be for the correct value of dir. In addition, binary distributions are available for some common Linux distributions see the FAQ for current details and for macOS. These are installed in platform-specific ways, so for the rest of this chapter we consider only building from the sources.
Cross-building is not possible: installing R builds a minimal version of R and then runs many R scripts to complete the build.
First review the essential and useful tools and libraries in Essential and useful other programs under a Unix-alike , and install those you want or need. Choose a directory to install the R tree R is not just a binary, but has additional data sets, help files, font metrics etc. Untar the source code. This should create directories src , doc , and several more under a top-level directory: change to that top-level directory At this point North American readers should consult Setting paper size.
Issue the following commands:. Users of Debian-based bit systems 5 may need. Failures are not necessarily problems as they might be caused by missing functionality, but you should look carefully at any reported discrepancies.
Some non-fatal errors are expected in locales that do not support Latin-1, in particular in true C locales and non-UTF-8 non-Western-European locales. R may indicate inadequate resource limits see Running R. Note that these checks are only run completely if the recommended packages are installed. You could also copy the man page R.
If you want to install the complete R tree to, e. Note: you do not need to install R: you can run it from where it was built. This has the advantage of always keeping your source tree clean and is particularly recommended when you work with a version of R from Subversion.
You may need GNU make to allow this, and you will need no spaces in the path to the build directory. It is unlikely to work if the source directory has previously been used for a build. There are many settings which can be customized when building R and most are described in the file config. Note: if you already have R installed, check that where you installed R replaces or comes earlier in your path than the previous installation.
R by default provides help pages as plain text displayed in a pager, with the options see the help for help of displaying help as HTML or PDF. By default HTML help pages are created when needed rather than being built at install time. This is enabled by the configure option --enable-prebuilt-html. It is also possible that system security measures will prevent the server from being started, for example if the loopback interface has been disabled. You will not be able to build any of these unless you have texi2any version 5.
NB: texi2any requires perl. The info files are suitable for reading online with Emacs or the standalone GNU info program. There are some issues with making the PDF reference manual, fullrefman. The help files contain both ISO Latin1 characters e. We have provided four alternatives:.
The default. This works well both for on-screen viewing and for printing. One disadvantage is that the Usage and Examples sections may come out rather wide: this can be overcome by using in addition either of the options inconsolata on a Unix-alike only if found by configure or beramono , which replace the Courier monospaced font by Inconsolata or Bera Sans mono respectively.
You will need a recent version of the appropriate LaTeX package inconsolata 6 or bera installed. This needs LaTeX packages times , helvetic and if used courier installed.
Using the Latin Modern fonts. This uses fonts rather similar to Computer Modern, but is not so good on-screen as times. Using type-1 versions of the Computer Modern fonts by Vladimir Volovich. These type-1 fonts have poor hinting and so are nowhere near as readable on-screen as the other three options. A package to use composites of Computer Modern fonts. This works well most of the time, and its PDF is more readable on-screen than the previous two options.
There are three fonts for which it will need to use bitmapped fonts, tctt Unfortunately, if those files are not available, Acrobat Reader will substitute completely incorrect glyphs so you need to examine the logs carefully. Further options, e. For example, if you prefer to hyperlink the text and not the page number in the table of contents use.
Ebook versions of most of the manuals in one or both of. This requires ebook-convert from Calibre , or from most Linux distributions. A parallel make can be used but run make before make install. Those using GNU make 4. This is known as the R home directory. The prefix of the installation directories can be seen in the status message that is displayed at the end of configure. The installation may need to be done by the owner of prefix , often a root account. There is the option of using make install-strip see Debugging Symbols.
More precise control is available at configure time via options: see configure --help for details. Configure options --bindir and --mandir are supported and govern where a copy of the R script and the man page are installed.
Each of bindir , mandir and libdir can also be specified on the make install command line at least for GNU make. The configure or make variables rdocdir and rsharedir can be used to install the system-independent doc and share directories to somewhere other than libdir.
Note that installing R into a directory whose path contains spaces is not supported, and some aspects such as installing source packages will not work. Once again, it is optional to specify prefix , libdir or rhome the PDF manuals are installed under the R home directory. More precise control is possible. The PDF files are installed into the R doc tree, set by the make variable rdocdir.
A staged installation is possible, that it is installing R into a temporary directory in order to move the installed tree to its final destination. This will also uninstall any installed manuals. Target uninstall-tests will uninstall any installed tests, as well as removing the directory tests containing the test results.
Some platforms can support closely related builds of R which can share all but the executables and dynamic objects. Here name can be anything non-empty, and is used to name subdirectories of lib , etc , include and the package libs subdirectories. If you have installed multiple builds you can select which build to run by. In such cases you can install for extra builds by.
When sub-architectures are used the version of Rscript in e. Normally all installed architectures will run on the platform so the architecture of Rscript itself does not matter.
For some Linux distributions 10 , there is an alternative mechanism for mixing bit and bit libraries known as multilib. If the Linux distribution supports multilib, then parallel builds of R may be installed in the sub-directories lib bit and lib64 bit. The build to be run may then be selected using the setarch command.
For example, a bit build may be run by. The setarch command is only operational if both bit and bit builds are installed. If there is only one installation of R, then this will always be run regardless of the architecture specified by the setarch command. There can be problems with installing packages on the non-native architecture.
It is a good idea to run e. If you know where a bit Java is installed you may be able to run as root. When this mechanism is used, the version of Rscript in e.
Normally all installed architectures will run on the platform so the architecture of Rscript does not matter. There are many other installation options, most of which are listed by configure --help. Almost all of those not listed elsewhere in this manual are either standard autoconf options not relevant to R or intended for specialist uses by the R developers. One that may be useful when working on R itself is the option --disable-byte-compiled-packages , which ensures that the base and recommended packages are not byte-compiled.
This will be preferred where there are issues with the system implementation, usually involving times after or before On all tested OSes the system timezone was deduced correctly, but if necessary it can be set as the value of environment variable TZ. Options --with-internal-iswxxxxx , --with-internal-towlower and --with-internal-wcwidth were introduced in R 4.
These control the replacement of the system wide-character classification such as iswprint , case-changing wctrans and width wcwidth and wcswidth functions by ones contained in the R sources. Replacement of the classification functions has been done for many years on macOS and AIX and Windows : option --with-internal-iswxxxxx allows this to be suppressed on those platforms or used on others it is now the default for Solaris.
Replacing the case-changing functions is new in R 4. Replacement of the width functions has also been done for many years and remains the default. The width functions are of most importance in East Asian locale: their values differ between such locales. Replacing the system functions provides a degree of plaform-independence including to OS updates but replaces it with a dependence on the R version. By default, configure adds a flag usually -g to the compilation flags for C, Fortran and CXX sources.
Having debugging symbols available is useful both when running R under a debugger e. How well this is supported depends on the platform: it works best on those using GNU binutils. On macOS debugging symbols are not by default included in. This can be overridden by specifying. Setting these to an empty value will disable OpenMP for that compiler and configuring with --disable-openmp will disable all detection 13 of OpenMP.
Note that overridden values are not tested. The inferred values can be overridden in file config. Currently accepted values are plus some synonyms. Prior to R 3. There is support for using link-time optimization LTO if the toolchain supports it: configure with flag --enable-lto. The main benefit seen to date from LTO has been detecting long-standing bugs in the ways packages pass arguments to compiled code and between compilation units.
Whether toolchains support LTO is often unclear: all of the C compiler, the Fortran compiler 17 and linker have to support it, and support it by the same mechanism so mixing compiler families may not work and a non-default linker may be needed.
Unfortunately --enable-lto may be accepted but silently do nothing useful if some of the toolchain does not support LTO: this is less common than it once was. Various macros can be set in file config. For non-system compilers or if those wrappers have not been installed one may need something like. Note that R may need to be re-compiled after even a minor update to the compiler e.
LLVM has. It is said to be particularly beneficial to use -O3 for clang in conjunction with LTO. LTO effectively compiles all the source code in a package as a single compilation unit and so allows the compiler with sufficient diagnostic flags such as -Wall to check consistency between what are normally separate compilation units.
NB: as its name suggests, this option is intended only for checking installation of R and packages: it includes these library routines those called directly and all they depend on in each package. If this has been done, two testing routes are available. This re-runs all the tests relevant to the installed R including for example the code in the package vignettes , but not for example the ones checking the example code in the manuals nor making the standalone Rmath library.
This affects both checking the package examples part of make check and package sources part of make check-devel and make check-recommended. It does require a make command which supports the make -j n option: most do but on Solaris you need to select GNU make or dmake.
Alternatively, the installed R can be run, preferably with --vanilla. These tests can be run from anywhere: the basic tests write their results in the tests folder of the R home directory and run fewer tests than the first approach: in particular they do not test things which need Internet access—that can be tested by.
It is possible to test the installed packages but not their package-specific tests by testInstalledPackages even if make install-tests was not run. Note that the results may depend on the language set for times and messages: for maximal similarity to reference results you may want to try setting before starting the R session.
Your file system must allow long file names as is likely except perhaps for some network-mounted systems. If it does not also support conversion to short name equivalents a. DOS 8.
Installation is via the installer R Just double-click on the icon and follow the instructions. When installing on a bit version of Windows the options will include or bit versions of R and the default is to install both. You can uninstall R from the Control Panel. You will be asked to choose a language for installation: that choice applies to both installation and un-installation but not to running R itself.
It is possible to use other toolchains including that used for R 3. The toolsets used for bit Windows from —20 were based on Mingw-w The assistance of Yu Gong at a crucial step in porting R to Mingw-w64 is gratefully acknowledged, as well as help from Kai Tietz, the lead developer of the Mingw-w64 project.
Both building R and checking packages need a distribution of LaTeX installed, with the directory containing pdflatex on the path. If a test fails, there will almost always be a. Launch either Rgui or Rterm , preferably with --vanilla. Then run. These tests can be run from anywhere: they write some of their results in the tests folder of the R home directory as given by R. Two files are offered for download, R The first runs on macOS Package R For some older versions of the OS you can in principle it is little tested install R from the sources see macOS.
Rosetta emulation works really well, with a very few reports of problems with binary packages solved by re-compilation. To install, just double-click on the icon of the file you downloaded. These are Apple Installer packages.
Note the the installer is clever enough to try to upgrade the last-installed version of the application where you installed it which may not be where you want this time ….
If you update your macOS version, you should re-install R and perhaps XQuartz : the installer may tailor the installation to the current version of the OS. If you cannot find it there it was possibly installed elsewhere so try searching for it in Spotlight. This is usually referred to as R. You can run command-line R and Rscript from a Terminal 25 so these can be typed as commands as on any other Unix-alike: see the next chapter of this manual.
Those using the zsh shell the default for new user accounts as from Catalina might find the command R being masked by the zsh builtin r which recalls commands.
If you have installed both installer packages on an arm64 Mac, the last installed will be used. It has been reported that running R. APP may fail if no preferences are stored, so if it fails when launched for the very first time, try it again the first attempt will store some preferences. Users of R. Here are ways to avoid it:. Using the X11 graphics device or the Xbased versions of View and edit for data frames and matrices the latter are the default for command-line R but not R.
APP requires XQuartz to be installed. With XQuartz installed there are two fontconfig areas from different versions and it can help to set. APP and the R framework. Un-installation is as simple as removing those folders e. The installation consists of up to four Apple packages: 26 for the Intel build, org.
You can use sudo pkgutil --forget if you want the Apple Installer to forget about the package without deleting its files useful for the R framework when installing multiple R versions in parallel , or after you have deleted the files. NB: the package names are case-sensitive and the R domain is given inconsistently. You can list the files they installed in a Terminal by e.
The installer will remove any previous version 27 of the R framework which it finds installed. This can be avoided by using pkgutil --forget see the previous section. You should ensure that the shell has set adequate resource limits: R expects a stack size of at least 8MB and to be able to open at least file descriptors. For some compilers 28 and packages a larger stack size has been needed: MB has sufficed to date.
Various environment variables can be set to determine where R creates its per-session temporary directory. It is helpful to use the correct terminology. A package is loaded from a library by the function library.
Changing the set of default packages is normally used to reduce the set for speed when scripting: in particular not using methods will reduce the start-up time by a factor of up to two. But it can also be used to customize R, e. R packages are installed into libraries , which are directories in the file system containing a subdirectory for each package installed there.
Both sites and users can create others and make use of them or not in an R session. Packages may be distributed in source form or compiled binary form. Binary packages are platform-specific and generally need no special tools to install, but see the documentation for your platform for details. Note that you may need to specify implicitly or explicitly the library to which the package is to be installed.
This is only an issue if you have more than one library, of course. Alternatively, packages can be downloaded and installed from within R. Then download and install packages pkg1 and pkg2 by. The essential dependencies of the specified packages will also be fetched. Unless the library is specified argument lib the first library in the library search path is used: if this is not writable, R will ask the user in an interactive session if the default personal library should be created, and if allowed to will install the packages there.
If you want to fetch a package and all those it depends on in any way that are not already installed, use e. Function setRepositories can select amongst those repositories that the R installation is aware of.
Something which sometimes puzzles users is that install. Some possible reasons:. Naive users sometimes forget that as well as installing a package, they have to use library to make its functionality available. What install. On Windows it looks by default first at the list of binary versions of packages available for your version of R and downloads the latest versions if any. On Windows install. Windows binary packages for R are distributed as a single binary containing either or both architectures and bit.
No additional tools are needed if the package does not contain compiled code, and install. Those with compiled code need the tools see The Windows toolset to be on the path: this can be set from within an R session by something like. It will report success if the installation of the architecture of the running R succeeded, whether or not the other architecture was successfully installed.
The exceptions are packages with a non-empty configure. If configure. This can only be applied to a tarball, and will only succeed if both installs succeed.
If you have a package without compiled code and no Windows-specific help, you can zip up an installation on another OS and install from that zip file on Windows. However, such a package can be installed from the sources on Windows without any additional tools. On macOS install. The R. On R builds using binary packages, the default is type both : this looks first at the list of binary packages available for your version of R and installs the latest versions if any.
Note that most binary packages which include compiled code are tied to a particular series e. Installing source packages which do not contain compiled code should work with no additional tools. Package rJava and those which depend on it need a Java runtime installed and several packages need X11 installed, including those using Tk. See macOS and Java. A few of the binary packages need other software to be installed on your system.
Viewed 4k times. Improve this question. Did you try specifying the arguments? I think it's because R sees the package name as slidify-master , which is invalid. I'm sure Ramnath will be along shortly to help you out. I think it has something to do with Windows and encoding.
Are you able to install any package at all from github. Add a comment. Active Oldest Votes. Improve this answer. Sign up or log in Sign up using Google. Sign up using Facebook. These settings can therefore be re-used and act as default settings.
A named list can be used also to the same effect, and that allows multi-element character strings for each package which are concatenated to a single string to be used as the value for --configure-args. Analogous to configure. This is sometimes used to perform additional operations at the end of the package installation in addition to removing intermediate files.
Values greater than one are supported if the make command specified by Sys. This can also be used on Windows to install just the DLL s from a binary package, e. Can also be a named list of character vectors to be used as additional options, with names the respective package names.
Alternatively, a character string giving the directory in which to save the outputs. Ignored when installing from local files. Arguments to be passed to download. This is the main function to install packages.
It takes a vector of names and a destination library, downloads the packages from the repositories and installs them. If the library is omitted it defaults to the first directory in. If lib is omitted or is of length one and is not a group writable directory, in interactive use the code offers to create a personal library tree the first element of Sys.
For installs from a repository an attempt is made to install the packages in an order that respects their dependencies. You are advised to run update.
0コメント