How to install the Krisp package in R?

Asked

Viewed 182 times

3

I want to install the following package in R http://user.math.uzh.ch/furrer/software/KriSp/

It is in tar.gz format

I used the following command:

install.Packages("~/Krisp_0.4.tar. gz", Repos = NULL, type = "source")

When I try to install it the following message appears:

Warning: invalid package

Error: ERROR: no specified Packages

Warning in install.Packages

  • Put the command you used before giving this error message.

2 answers

1

To install this package the easiest way is to use the devtools.

Install the devtools using install.packages("devtools"). In Windows, devtools also asks for the installation of RTools that it is not a package but another program: http://cran.r-project.org/bin/windows/Rtools/

Krisp seems to have been made in earlier versions of R and does not have a NAMESPACE file in its source code. Therefore, it is necessary to unzip the code, and add this file in the folder. I unzipped using 7zip and then created a copy of DESCRIPTION file, renamed it to NAMESPACE and deleted the contents.

Then using the command:

devtools::install_local("caminho para a pasta com o codigo fonte")

Example:

devtools::install_local("C:/Users/daniel/Desktop/KriSp_0.4.tar/KriSp_0.4/KriSp/")

You should be able to install the package.

  • Daniel, I unzipped the file, made a copy of the DESCRIPTION file, changing the name to NAMESPACE, but I did not understand this last step of deleting the content?

  • just open the file with the notepad, delete everything written and then save!

  • I did exactly what you said, but you say it’s not a package of R, because it has no description.

  • How are you putting the path of the folder?

  • 1

    Like this: devtools::install_local("D:/Users/Andre/Documents/Krisp_0.4.tar/Krisp_0.4/Krisp")

  • 1

    +1 by devtools, which is an excellent package

  • An addendum: devtools need Rtools only to build packages, but for more basic functions like install_github no need to install Rtools .

  • Molx, when you install a package from source the devtools build on your machine, so you need to have Rtools. Perhaps when the package is pure R, it is not necessary, but if the package has C codes, for example, Rtools will be required.

  • 1

    Andre, it’s hard to figure out the problem from :( This error that is appearing seems to be related to DESCRIPTION file. See if it is identical to when you unpacked the package.

Show 4 more comments

0

An alternative answer to Daniel’s, without using the devtools.

First you have to install the package dependencies (the other packages of which the KriSp depends on):

install.packages(c("fields","SparseM"), repos = "http://cran.r-project.org")

Then you download the file and have it installed as type "source" because it is not in binary format:

install.packages("KriSp_0.4.tar.gz", repos = NULL, type = "source")

However, as Daniel said, since this package was made at a time when there was no NAMESPACE, if you try this in recent versions of R you will have problems.

NAMESPACE roughly says which functions you will export to the user in the global environment, which functions you will not export, which packages or functions of other packages you will import etc. Then you can do the following: unzip the Krisp folder from within tar and create a plain text file called NAMESPACE with the following content.

exportPattern("^[^\\.]")

You’re basically having all functions exported that don’t start with a dot. Now just have it installed by "source" again, but this time putting the name of the folder and not the name of tar.

install.packages("KriSp", repos = NULL, type = "source")

I just tested it here and it worked. However, just because you installed it doesn’t mean it’s okay, so it’s worth noting that this package may be full of compatibility issues, since it hasn’t been serviced for a long time.

  • Carlos, this first part I did, but as I said this package is very old, in this new version of R I believe that does not install

  • @Andre with the commands I listed install, as I just installed here.

  • Carlos could send me his Krisp folder?

  • @Andre blz, later put in Dropbox and pass the link

  • Do that kindness Carlos, I can’t install.

  • @Andre follows the link: https://dl.dropboxusercontent.com/u/44201187/KriSp.zip

  • Carlos, are you sure you were able to install the package?

  • yes, @Andre, I’m sure

  • Which version of your R? Dude doesn’t install in my.

Show 4 more comments

Browser other questions tagged

You are not signed in. Login or sign up in order to post.