Cannot install package from local place


#1

Hi everyone, may be someone of yuo know how correct this problem. I don't have disk D and worc only with C, and can not install any package from there. the mistakes like :slight_smile:Warning in install.packages :
'lib = "C:/Program Files/R/R-3.5.0/library"' is not writable
Warning in install.packages :
unable to access index for repository C:/Users/lkod/Downloads/src/contrib:
scheme not supported in URL 'C:/Users/lkod/Downloads/src/contrib/PACKAGES'
Warning in install.packages :
package ‘plyr_1.8.4.tar.gz’ is not available (for R version 3.5.0)
Warning in install.packages :
unable to access index for repository C:/Users/lkod/Downloads/bin/windows/contrib/3.5:
scheme not supported in URL 'C:/Users/lkod/Downloads/bin/windows/contrib/3.5/PACKAGES'


#2

You have a few issues in there — the first of which appears to be related to not having write-access to your library directory.

You haven't shown your input here, but you need to be sure to specify the correct path, etc. (see answer from SO below)


#3

and if this is my package then it is necessary to file it in .tar.gs expansion


#4

Does it work without your doing so?


#5

no
this mistake:
Warning: invalid package 'C:/Users/lkod/Documents/R/win-library/3.5/score.zip/score/score.Rproj'
Error: ERROR: no packages specified
In R CMD INSTALL
Warning in install.packages :
installation of package ‘C:/Users/lkod/Documents/R/win-library/3.5/score.zip/score/score.Rproj’ had non-zero exit status


#6

Can you please show your input and output? It looks like you haven't specified what to install.


#7

Hi,

what are you trying to install ?

  • A :package: from a local cran repository on your local filesystem, that you created or have access to on?
  • A :package: from source that you downloaded or build locally (*.tar.gz) ?
  • A :package: you are working on in a RStudio project (a folder)?
  • A :package: in a local git repository ?

There is a solution for each of this one, so we need more information in order to help you.


#8

I've build package, it's holding on my disk C, and now in shinyapp I must use functions from this my own pakage but can not install it. it's write smth:
(as ‘lib’ is unspecified)
Warning: invalid package 'C:/Users...'
Error: ERROR: no packages specified
In R CMD INSTALL
Warning in install.packages :
installation of package ‘C:/Users/lkod/Documents/R/win-library/3.5’ had non-zero exit status

library(score)
Error in library(score) : ‘score’ is not a valid installed package


#9

I wrie:

install.packages("C:/Users/lkod/Documents/R/win-library/3.5",repos = NULL, type="source")
library(score)
 and R write to me:
Installing package into ‘C:/Users/lkod/Documents/R/win-library/3.5’
(as ‘lib’ is unspecified)
Warning: invalid package 'C:/Users/lkod/Documents/R/win-library/3.5'
Error: ERROR: no packages specified
In R CMD INSTALL
Warning in install.packages :
  installation of package ‘C:/Users/lkod/Documents/R/win-library/3.5’ had non-zero exit status
> library(score)
Error in library(score) : ‘score’ is not a valid installed package

#10

Yes, you haven't installed score so you can't load it.
You need to specify the package you're installing.


#11

you didn't install anything in this step. You could install something with:

install.packages('score')

or run ?install.packages to see the help on how to install.


#12

When working with your own package, you can use devtools::install_local() to install either from a local directory containing source package, or either from a build source packages tar.gz. See the help

You can also install a package you build locally with install.packages("<path-to-your-package>", type = 'source', repos =NULL). see help(install.packages)

You tried it but not providing the good path to your package in pkgs argument.

Can you try to install correctly as explained in docs and see if it is ok ?


#13

how i can do that? is it problem only in path?


#14

tried twise:

...
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Error in dev_meta(pkg$package) : 
  Namespace not found for score. Is it loaded?
Error in unregisterNamespace(package) : namespace not registered
ERROR: lazy loading failed for package 'score'
* removing 'C:/Users/lkod/Documents/R/win-library/3.5/score'
* restoring previous 'C:/Users/lkod/Documents/R/win-library/3.5/score'
In R CMD INSTALL
Warning in install.packages :
  installation of package ‘C:/Users/lkod/Desktop/R_scripts/home/new_score/score’ had non-zero exit status
> library(score)
> ?download()
Error in .helpForCall(topicExpr, parent.frame()) : 
  no methods for ‘download’ and no documentation for it as a function
> install.packages("C:/Users/lkod/Desktop/R_scripts/home/new_score/score",  type="source", repos = NULL)
Installing package into ‘C:/Users/lkod/Documents/R/win-library/3.5’
(as ‘lib’ is unspecified)
* installing *source* package 'score' ...
** R
** inst
** byte-compile and prepare package for lazy loading
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Loading score
Error in dev_meta(pkg$package) : 
  Namespace not found for score. Is it loaded?
Error in unregisterNamespace(package) : namespace not registered
ERROR: lazy loading failed for package 'score'
* removing 'C:/Users/lkod/Documents/R/win-library/3.5/score'
* restoring previous 'C:/Users/lkod/Documents/R/win-library/3.5/score'
In R CMD INSTALL
Warning in install.packages :
  installation of package ‘C:/Users/lkod/Desktop/R_scripts/home/new_score/score’ had non-zero exit status

#15

As @jdlong mentioned, you need to install the package score currently you've set up your arguments such that it looks like you're trying to install a package with the name of your full file path.

The first argument of the function install.packages() is pkgs. If you are trying to install a package from the a local downloaded tar file, you need to specify type = "source". If you're on windows, you also need to make sure you have rtools installed.

See the stack overflow thread here: