i have two library path how can I override that via an argument to both install.packages() (from inside R) or R CMD INSTALL (outside R).
or override by setting the R_LIBS_USER variable.
The usual reason to end up with two libraries is that the system library is not writable when you install new packages.
So if you only want one path in .libPaths(), always run with elevated permissions ("Run as administrator" on Windows, use sudo on others) when you install packages.
It's probably a better idea not to install packages in the system library other than the base packages that come with R, because it's very easy to forget to change privileges, and then you can end up with two libraries again, and have one version of a package in the system library and a different version in the user library.
I have been to their website. I have viewed a YouTube on a related subject. And, so far I don't really get it. My objective is to use Pandoc in conjunction with R Markdown to convert R Markdown HTML document into either Word or Pdf files.
You can install pandoc in several ways:
Using the x86 or x64 executable from here and installng like any other Windows app: pandoc downloads
Using the x86 or x64 flavor of the zip file (same link shown above), and unpack it on the folder of your preference. Then, set manually the path to that folder. Pandoc is only a couple of files pandoc.exe and pandoc-citeproc.exe. You may even copy then to your /bin folder of your preference if want to save adding another PATH.
Using the R package installr, and then run installr::install.pandoc().
It will automatically install the Windows msi and add the PATH for you.
You may review the user path in environment variables: C:\Users\user_name\AppData\Local\Pandoc\.
Reload the environment variables by restarting your PC.
If you have RStudio installed (and most R users do) then you already have a pandoc binary. Maybe just add that directory to your $PATH ?
If you have the Chocolatey package manager installed on your Windows machine, you can install the Pandoc package with:
choco install pandoc
I am using R CMD INSTALL to install libraries from a folder with .zip binaries to my rlibs directory. When I do this, many folders for each library are installed in the rlibs directory. Take for example the bit package. I have downloaded the bit_1.1-12.zip file from https://cran.r-project.org/web/packages/bit/index.html.
Now I install it by using the following command:
R CMD INSTALL --library=./r_libs ./external/bit_1.1-12.zip
This will create a file structure underneath the folder ./r_libs/bit
Now here is my question: How can I install only the essential library files that R needs to import? I believe this is the ./r_libs/bit/libs/ folder (I might be wrong). Currently there is plenty of additional folders installed, such as html, help, Meta, and more.
I have tried several options that R CMD INSTALL --help gives me. The description in https://stat.ethz.ch/R-manual/R-devel/library/utils/html/INSTALL.html tells me to install just the compiled code for another sub-architecture, use --libs-only. However,
R CMD INSTALL --libs-only --library=./r_libs ./external/bit_1.1-12.zip
gives me an error message that there is no ./r_libs/bit/lib directory. The options --no-html, --no-help seem to not do anything.
I am working on a Windows 7 machine using R add-on package installer 3.0.2.
What am I missing here?
Thank you.
I unpacked the new version of R package and inside a folder I gave commands:
./configure
make
Now I want to run it, if I give command:
$ R
Then it runs the older version. and I have no privilege to deal with it. so I want to run the new installed version. any help?
Perhaps it needs to be exported but i am not familiar with these steps.
thanks
To execute the new version of R, run bin/R within the installation directory.
To move it to a globally accessible location, run
make install
If you don't have permission to do so (as you indicate), you can alter the directory that make install moves R to to one where you do have permission at the ./configure step:
./configure --prefix=/where/you/want/R/to/go
make
make install
I am trying to check a package that I have built (with vignette) using R CMD check --as-cran [my package] in my windows command prompt. All goes well until I get the message,
WARNING 'qpdf' is needed for checks on size reduction of PDFs
I have downloaded qpdf, put the unzipped folder in my program files directory, and added the bin folder to the PATH.
Not quite sure what else I need to do? I have the feeling I have not installed qpdf correctly or I need to build this program itself? I have read through the readme files and manual for qpdf which appear to be more aimed at unix users (which I have no experience with... I am your standard/regular windows user with little to no programming experience outside of statistical languages). I have had a go at trying to build qpdf using cgywin, but ended up failing to install zlib and prec. Any tips?
I would try
Sys.which(Sys.getenv("R_QPDF", "qpdf"))
Sys.getenv("PATH")
to establish that R is really not finding the qpdf executable, and see where it is looking. You probably shouldn't need to rebuild everything, just figure out why R is not finding the qpdf executable ... does running qpdf from a terminal window work ... ? How are you starting R, and did it have a chance to get the new PATH definition (i.e. do you need to open a new terminal window, or ?? reboot ??)
The incantation above was extracted from tools::compactPDF, from the default value of the qpdf argument, on a Linux machine. You should check for yourself, in case (e.g.) the Windows version is looking for qpdf.exe rather than qpdf ...
There are a couple of other things to consider on a Windows machine:
If you are running the 32-bit version of R, it is important that you download the 32-bit version of qpdf, which is the version linked from the SourceForge homepage. If you are running a 64-bit installation of R, you will need to do a bit of digging to locate the 64-bit version of qpdf, which is buried a little more deeply (version 7.0 is listed here).
Once you have extracted the zipped qpdf directory to your hard disk, perhaps under C:\Program Files\, added C:\Program Files\qpdf-version_number\bin to your system PATH under the environment variables, and re-launched R, Windows needs to establish that pqdf is safe to run.
Navigate to C:\Program Files\qpdf-version_numer\bin and execute qpdf.exe (by double-clicking). Windows 10 throws up a security warning, as it's an unrecognized executable file. You'll need to use the more options link to find the button to run the program. This done, Windows will recognize the file as safe to run and allow other software, including R, to use it.
Recent developments: If you install Rtools 3.5 qpdf is included and that warning is gone. Rtools is a toolset for building packages on Windows and is recently reworked by Jeroen Ooms.
More information : https://cran.r-project.org/bin/windows/Rtools/
Note that the changelog is incomplete, as Rtools 3.5 isn't frozen yet at the time of writing (2019-03-01). Even though it's not visible on the page yet, qpdf.exe is included in the bin directory after installation.
After installing the latest version of RTools, the warning still popped up.
However, I noticed that the Windows "where" command gave two paths to qpdf (different versions). After removing the R_QPDF environment variable and removing the new install of qpdf from the Windows path, so that only qpdf in RTools was found, the warning disappeared.
I got the same warning on Ubuntu so here's a Ubuntu solution for completeness:
First update packages
sudo apt update
Then install qpdf with
sudo apt install qpdf
Tested on Ubuntu 20.04.