cs0815
cs0815

Reputation: 17408

install R package requiring dll

I am looking at this package. I managed to install it like this:

library(devtools)
install_github("profyliu/gepR")

This package also requires a dll, which I downloaded. I think I can put this dll into my working directory but could it also be placed into the folder of the package and the R file would pick it up automatically (the R file linked to in github is also in my local package folder)?

Thanks and sorry about my ignorance.

Upvotes: 0

Views: 299

Answers (1)

MacOS
MacOS

Reputation: 1159

I think you can. Look at function gep_load_dll from gepR.R

#' Load gepR.dll
#' @param dll_file the path and name of the dll file to be loaded.
gep_load_dll <- function(dll_file = "gepR.dll"){
  dyn.load(dll_file)
}

I think you just have to change the variable for this function such that it is the path to the dll file. To me it seems that the package does not care where you put it.

So just put the file into the directory you want, call this function with the path to the file and you should be fine. Particularely, when we also consider the example from the demo, where we find this code

gep_load_dll()  # Load the gepR.dll from the default location
gepmod <- gep_train(y = train_y, x = train_x, maxiter = 1000, goal=0.95, nthreads = 10)

The comment seems to suggest that you can put it anywhere you like as long as you overwrite the default location.

Please note that I have not tried it out myself because I'm not a windows user. If it works, please let us know.

Upvotes: 1

Related Questions