user2588829
user2588829

Reputation: 1583

installing a package in R by copying code?

I must run R code on a virtual machine that does not have an internet connection and only has an old version of R installed (R 2.10.1). I want to install the package LiblineaR, which was first created for a version of R that is more recent than 2.10.1. For this reason, I can't install it by just secure copying the tar.gz file over to the virtual machine, because the tar.gz file only works for newer versions of R.

When I simply try to copy the code for the "LiblineaR" function, it also doesn't work because when I call that function, it gives me the message:

Error in .C("trainLinear", as.double(W), as.double(if (sparse) data@ra else t(data)),  : 
C symbol name "trainLinear" not in load table

Does anyone know how I can work around this (or what the error message means?)

Let me know if I can provide any extra information.

Upvotes: 0

Views: 333

Answers (3)

user2588829
user2588829

Reputation: 1583

It was actually a very simple fix, I was copying the function definition along with the line <environment: namespace:data.table> at the end. Once I didn't copy that line, it worked. My apologies for creating a ruckus about nothing.

Upvotes: 1

holzben
holzben

Reputation: 1471

The „trainLinear“ function you can find in the src folder for the package . To source the provided C/C++ code should not be the problem, but the next problem you will face is that the package depends on other packages as well (eg. See R code in package library("SparseM") ) and the whole thing starts again.

If you solved all that problems it´s still like Eric said, you can get a problem with build in functions of the tow R versions.

I think it is easier to work on the internet problem :)

HTH

Upvotes: 0

Eric Brown
Eric Brown

Reputation: 13932

I'm going to borrow Raymond Chen's patented Psychic Debugging Powers and say that it's not possible; the package you want to install has dependencies on builtin R functions that don't exist in R 2.10.1 but do exist in R 2.15.2 (hence the requirement).

The line

C symbol name "trainLinear" not in load table

strongly suggests a dependency on a native C function.

Upvotes: 1

Related Questions