


Prepara tus exámenes y mejora tus resultados gracias a la gran cantidad de recursos disponibles en Docsity
Gana puntos ayudando a otros estudiantes o consíguelos activando un Plan Premium
Prepara tus exámenes
Prepara tus exámenes y mejora tus resultados gracias a la gran cantidad de recursos disponibles en Docsity
Prepara tus exámenes con los documentos que comparten otros estudiantes como tú en Docsity
Encuentra los documentos específicos para los exámenes de tu universidad
Estudia con lecciones y exámenes resueltos basados en los programas académicos de las mejores universidades
Responde a preguntas de exámenes reales y pon a prueba tu preparación
Consigue puntos base para descargar
Gana puntos ayudando a otros estudiantes o consíguelos activando un Plan Premium
Comunidad
Pide ayuda a la comunidad y resuelve tus dudas de estudio
Ebooks gratuitos
Descarga nuestras guías gratuitas sobre técnicas de estudio, métodos para controlar la ansiedad y consejos para la tesis preparadas por los tutores de Docsity
Instructions on installing the r commander package in r, including general installation notes, specific instructions for windows, linux, and macos systems, and troubleshooting common installation issues. It also covers the installation of optional software for creating editable word or open office documents and pdf files.
Tipo: Apuntes
1 / 4
Esta página no es visible en la vista previa
¡No te pierdas las partes importantes!



The Rcmdr package is a standard R package, and it installs and is loaded in the normal manner. There are, however, a few installation issues, particularly on Macintosh systems, and these are described in this document. For more detailed basic installation instructions, see Ch. 2 of my book Using the R Commander. A general point is keep in mind is that the Rcmdr package uses a number of other "contributed" packages (in addition to packages, such as tcltk and MASS , that are part of the standard R distribution), and these must be present for it to work properly. Many of these packages have their own dependencies, which depend on still other packages, etc. These additional packages will either be installed along with the Rcmdr package or the Rcmdr will offer to install them when it first starts up (and you should accept the offer).
The following instructions may be all you need to get started; for more detailed instructions and potential installation issues, see the various sections below. These instructions assume that you have an active Internet connection.
Ocassionally, an R package or packages required by the Rcmdr package fails to be installed and the R Commander can't start. When this happens, there is typically an informative error message about the missing package(s). There are two common causes for this problem: (1) The package(s) in question may be temporarily missing from the CRAN mirror that you used; or (2) the package(s) may be permanently unavailable for an older version of R. In the first instance, you can install (each) missing package directly via the command install.packages(" package-name "), or, for more than one missing package, install.packages(c(" package-1-name ", " package-2-name ", etc )) , selecting a different CRAN mirror from the one you used initially. In the second instance, you can install the current version of R (always a good idea), and start again. If you wish to start the R Commander automatically when R starts up, you can add a plain-text ("ascii") file named .Rprofile to your home directory, with the following contents: local({ old <- getOption("defaultPackages") options(defaultPackages = c(old, "Rcmdr")) }) To determine your home directory, type the command getwd() ("get working directory") at the > command prompt in a fresh R session. Be sure to use a plain-text editor to create this file, not a word processor like Word, or, if using a word processor, to save the file as a plain-text file.
If the general installation procedure and installation issues above are insufficient, here is specific information for Windows, Linux, and macOS systems:
The easiest way to install the Rcmdr package is via the Rgui Packages -> Install packages menu or via the command install.packages("Rcmdr") entered at the R > command prompt. R will ask you to select a CRAN mirror; pick the first, "0- Cloud" mirror, or a mirror site near you. When you first load the Rcmdr package with the command library("Rcmdr"), it will offer to download and install missing dependencies; allow it to do so. If you installed R in Program Files, you may prefer to run R with adminstrator privileges to install packages: Right click the R icon and select "Run as administrator." Otherwise, packages will be installed in a package library particular to your user account rather than the main R package library; that should work OK too. I suggest that you install R into a
different directory, such as C:\R, to avoid this issue. On Windows, the Rcmdr package works best with the "single-document "R interface (SDI). Under the default "multiple-document interface" (MDI), R Commander dialog boxes may not stay on top of the main R window. In the Startup options screen of the R installer, select Yes (customized startup). Then select the SDI (single-document interface) in preference to the default MDI (multiple- document interface); feel free to make other changes, but you may take all the remaining defaults. If you install R with the standard MDI, to enable the SDI you can make a copy of the R desktop icon (right-click on the icon, drag it to a different location on the desktop, select Copy Here from the context menu). Right-click the new icon and select Properties. Add -- sdi (preceded by a space) to the Target field on the Shortcut tab of the Properties dialog box. The field should read something like "C:\Program Files\R\R- x.y.z \bin\Rgui.exe" --sdi, where x.y.z specifies the version of R you installed. If you wish, change the name of the icon on the General tab (e.g., to R x.y.z SDI ). Click OK. Alternatively, you canyou can edit the Rconsole file in R's etc subdirectory to select the SDI.
Linux/Unix systems typically have all of the software required for building packages already installed. The easiest way to install the Rcmdr package is to run R as root and issue the command install.packages("Rcmdr") at the R prompt. R will ask you to select a CRAN mirror; pick the first, "0-Cloud" mirror, or a mirror site near you. On Ubutu systems, in particular, the following procedure should work (slightly modified from a suggestion by Ista Zahn):
These instructions are for R version 3.6.1 or later; if you're using an earlier version of R, I suggest that you upgrade (in fact, it's generally a good idea to upgrade to the current version of R), or, failing that, consult the special macOS installation notes for the R Commander under older versions of R. R 3.6.1only supports macOS version 10.11 (El Capitan) or higher. Please read these instructions carefully, as they are a little complicated. Before installing R and the R Commander, make sure that your macOS system is up-to-date by running Software Update from the "apple" menu at the top-left of the screen. This is important, because R assumes that the system is up-to-date and may not function properly if it is not. Install the current version of Rr from the Comprehensive R Archive Network (CRAN), selecting a mirror site near you; a list of CRAN mirrors appears at the upper left of the CRAN home page. Check to see whether the X11 windowing system (X Windows) has already been installed on your computer. For OS X 10. and 10.7 , the file X11.app should appear in the Utilities folder under Applications in the finder. This application should always be installed under OS X 10.7. For OS X 10.8 or higher, the file is named XQuartz.app and is no longer included with the operating system. XQuartz.app may also be installed in OS X 10.6 or 10.7. (The R Commander uses the tcltk package for R, which requires X-Windows.) Note that if and when you upgrade OS X, you will have to reinstall XQuartz even if you installed it previously. If neither X11.app nor XQuartz.app is installed, install XQuartz. In fact, regardless of whether some version of X-Windows is installed on your computer, it shouldn't hurt to install the current version of XQuartz. Download the disk image (dmg) file for XQuartz. When you open this file by double-clicking on it, you'll find XQuartz.pkg; double-click on it to run the installer, clicking through all the defaults. After the installer runs, you'll have to log out and back on to your macOS account, or just reboot your computer. Start R by running R.app. At the > command prompt, type the following command and press the return key: install.packages("Rcmdr") R will ask you to select a CRAN mirror; pick the first, "0-Cloud" mirror, or a mirror site near you. Once it is installed, to load the Rcmdr package, simply issue the command
the /usr/local directory or a subdirectory of it, probably by misbehaving software. Error : .onLoad failed in loadNamespace() for 'tcltk', details: call: dyn.load(file, DLLpath = DLLpath, ...) error: unable to load shared object '/Library/Frameworks/R.framework/Versions/3.0/Resources/library/tcltk/libs/ tcltk.so': dlopen(/Library/Frameworks/R.framework/Versions/3.0/Resources/library/tcltk /libs/tcltk.so, 10): Library not loaded: /usr/local/lib/libtcl8.6.dylib Referenced from: /Library/Frameworks/R.framework/Versions/3.0/Resources/library/tcltk/libs/t cltk.so Reason: no suitable image found. Did find: /usr/local/lib/libtcl8.6.dylib: stat() failed with errno= /usr/local/lib/libtcl8.6.dylib: stat() failed with errno= You can verify the source of this problem by issuing the following command at the R command prompt: system("ls -ld /usr/local /usr/local/lib /usr/local/lib/libtcl") If there is a file-permissions problem, you should see something like ls: /usr/local/lib: Permission denied ls: /usr/local/lib/libtcl: Permission denied drwx------ 8 root wheel 272 Sep 24 10:21 /usr/local Having confirmed the problem, you can change the file permissions in /usr/local by opening a terminal window on your Mac (Terminal.app is in the Applications Utilities folder), and entering the following command at the $ prompt in the terminal window: sudo chmod -R a+rX /usr/local The operating system will ask you to supply your password to execute this command. If you are using macOS 10.9 ("Mavericks") or later and the R Commander becomes slow or unresponsive, you can run R and the R Commander in a terminal window on your Mac rather than from R.app or prevent your computer from "napping" while R.app is running.. See the installation notes above. Installing Optional Pandoc and LaTeX Software Installing R and the Rcmdr package is sufficient for creating HTML (web page) reports via the R Markdown document that the R Commander builds for each session, but if you prefer to create editable Word or Open Office documents or PDF files for reports, you will have additionally to install Pandoc and LaTeX (the latter, in conjunction with Pandoc, for PDF reports). The most convenient way to do this is via the R Commander Tools > Install auxiliary software menu (which appears only if Pandoc or LaTeX is absent). Last modified: 2019-09-03 by John Fox