-1

I'm using DeployR for Microsoft R Server 2016, 8.0.5 for Windows.

I would like to install package XLConnect for work with Excel files:

> install.packages("XLConnect")
package 'XLConnect' successfully unpacked and MD5 sums checked

The downloaded binary packages are in
C:\Windows\Temp\RtmpYnppvI\downloaded_packages

> library("XLConnect")
Console Error there is no package called 'XLConnect'
API Error there is no package called 'XLConnect'

What could be wrong? Thank you.

Anette
  • 90
  • 1
  • 5

1 Answers1

0

If we are working with deployR, there is a package named deployrUtils which already has the deployrPackage function to load and install the package (if not present)

library(deployrUtils)
deployrPackage("XLConnect")

Below is the code snippet for deployrPackage

deployrPackage <- function(pkgs, lib, repos = getOption("repos"), ...) {
  #
  # this function checks to see if the declared pkgs are installed. If not, 
  # pkgs are installed. In all cases the packages are loaded
  #
  if (!suppressWarnings(require(pkgs, character.only = TRUE))) {
    install.packages(pkgs, lib, repos = repos, ...)
    if(!suppressWarnings(require(pkgs, character.only = TRUE))) {
      stop("Package not found")
    }
  }

  suppressWarnings(require(pkgs, character.only = TRUE))
}

More info about the different functions in deployrUtils can be found here

akrun
  • 874,273
  • 37
  • 540
  • 662
  • Thank you, I understand, but I figured now that even with `deployrPackage("XLConnect")` get the same message, so any package that I try to load does not work, unfortunately. – Anette Feb 16 '17 at 07:33
  • @Anette Please check your configuration. It should work based on the guidelines and I also use deployR – akrun Feb 16 '17 at 07:35
  • Yes, sure. Well I'm new in deployR. I don't have Admin permissions, so I guess the problem is because of that? – Anette Feb 16 '17 at 08:39
  • @Anette Yes, it could be due to that. – akrun Feb 16 '17 at 08:40
  • Some time has passed and I'm trying to solve the problem again...unfortunately I still can't install any of new packages on DeployR. I moved `XLConnect_0.2-11.zip` to libraries (`.libPaths()`) and unpacked it, so installed.packages() contains `XLConnect` then. But I know, on this way new package is not installed properly.. I also trying to install packages through Interactive API Explorer (tab Packages). – Anette Feb 28 '17 at 08:40
  • @Anette Now with Microsoft R server 9.0.1, it is called operationalization with more features and easy deployment by calling a single line code with msrdeploy package – akrun Feb 28 '17 at 08:41
  • Yes. Nevertheless I'm insisting to solve installing. But I see, that I will have to try 9.0.1. – Anette Feb 28 '17 at 10:07
  • There is a problem with installing `XLConnect` also in 9.0.1. My code is: `REMOTE> install.packages("XLConnect")`, and then `library("XLConnect")`, but get an error: `Package or namespace load failed for 'XLConnect'` – Anette Mar 06 '17 at 09:50
  • @Anette I am not sure about the error. If you have an older version, remove that and then do a fresh install – akrun Mar 06 '17 at 10:02