R error in package "glmnet": error backage foreach - r

I have R version 3.4.3. I'm working on a school project with glmnet.
I've tried to install the package and I didn't get any error code, but when I ask for with library(glmnet) I get these errors.
I have tried to remove it, installing it back, install foreach alone: the same problem!!
install.packages("glmnet", dependencies=TRUE)
Installing package into �C:/Users/freel_000/Documents/R/win-library/3.4�
(as �lib� is unspecified)
also installing the dependency �foreach�
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.4/foreach_1.4.4.zip'
Content type 'application/zip' length 388581 bytes (379 KB)
downloaded 379 KB
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.4/glmnet_2.0-13.zip'
Content type 'application/zip' length 1769167 bytes (1.7 MB)
downloaded 1.7 MB
package ‘foreach’ successfully unpacked and MD5 sums checked
package ‘glmnet’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\freel_000\AppData\Local\Temp\Rtmpy4iKye\downloaded_packages`

Related

Error loading tidyverse after fresh install - R (loadNamespace, broom, backports)

I just updated R to version 4.0.2 and updated RStudio Desktop to version 1.3.959. As seen in the code below, I am unable to load tidyverse after what appears to be a successful installation. However, data.table installs and loads perfectly fine. Does anyone have experience with this? Thanks!
Code from console (tidyverse error):
> install.packages('tidyverse')
Installing package into ‘C:/Users/iangm/Documents/R/win-library/4.0’
(as ‘lib’ is unspecified)
also installing the dependencies ‘RColorBrewer’, ‘scales’, ‘dplyr’, ‘ggplot2’
trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.0/RColorBrewer_1.1-2.zip'
Content type 'application/zip' length 55583 bytes (54 KB)
downloaded 54 KB
trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.0/scales_1.1.1.zip'
Content type 'application/zip' length 560984 bytes (547 KB)
downloaded 547 KB
trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.0/dplyr_1.0.0.zip'
Content type 'application/zip' length 1302777 bytes (1.2 MB)
downloaded 1.2 MB
trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.0/ggplot2_3.3.2.zip'
Content type 'application/zip' length 4068169 bytes (3.9 MB)
downloaded 3.9 MB
trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.0/tidyverse_1.3.0.zip'
Content type 'application/zip' length 440050 bytes (429 KB)
downloaded 429 KB
package ‘RColorBrewer’ successfully unpacked and MD5 sums checked
package ‘scales’ successfully unpacked and MD5 sums checked
package ‘dplyr’ successfully unpacked and MD5 sums checked
package ‘ggplot2’ successfully unpacked and MD5 sums checked
package ‘tidyverse’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\iangm\AppData\Local\Temp\RtmpkNazQW\downloaded_packages
> library(tidyverse)
Error: package or namespace load failed for ‘tidyverse’:
.onLoad failed in loadNamespace() for 'broom', details:
call: loadNamespace(name)
error: there is no package called ‘backports’
Code from console (data.table success):
> install.packages('data.table')
Installing package into ‘C:/Users/iangm/Documents/R/win-library/4.0’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.0/data.table_1.12.8.zip'
Content type 'application/zip' length 2325868 bytes (2.2 MB)
downloaded 2.2 MB
package ‘data.table’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\iangm\AppData\Local\Temp\RtmpkNazQW\downloaded_packages
> library(data.table)
data.table 1.12.8 using 2 threads (see ?getDTthreads). Latest news: r-datatable.com
There can be some problem with package backports: try to reinstall that package and load tidyverse again:
install.packages("backports")
library(tidyverse)
If that doesn't work, there might be problem with packages built under an earlier major version of R (i.e. 3.x). Try reinstalling all the packages with:
update.packages(ask = FALSE, checkBuilt = TRUE)
See more info here:
Is there a way to automate reinstalling packages and their dependencies in r?

Unable to Load Built in Dataset

I'm trying to load the catsM dataset, but continue to get this error. I've tried the basics, restarting Rstudio, re-installing the package, etc., but continue to get this error.
install.packages("boot")
Installing package into ‘C:/Users/becky/Documents/R/win-library/3.6’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.6/boot_1.3-25.zip'
Content type 'application/zip' length 643617 bytes (628 KB)
downloaded 628 KB
package ‘boot’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\becky\AppData\Local\Temp\RtmpgHPMII\downloaded_packages
> library(boot)
> datasets:catsM
Error: object 'datasets' not found

Fail to install the "tidyverse" package

I am creating a plot using the ggplot() function in R Studio. For doing the job, I need to install the "tidyverse" package, but find installation failure. I will appreciate if you could solve the problem. The error messages are displayed in the console pane:
install.packages("tidyverse")
Installing package into ‘C:/Users/cheol/OneDrive/문서/R/win-library/3.6’
(as ‘lib’ is unspecified)
also installing the dependency ‘purrr’
trying URL 'https://cran.cnr.berkeley.edu/bin/windows/contrib/3.6/purrr_0.3.3.zip'
Content type 'application/zip' length 426130 bytes (416 KB)
downloaded 416 KB
trying URL 'https://cran.cnr.berkeley.edu/bin/windows/contrib/3.6/tidyverse_1.3.0.zip'
Content type 'application/zip' length 440226 bytes (429 KB)
downloaded 429 KB
package ‘purrr’ successfully unpacked and MD5 sums checked
Error in install.packages : ERROR: failed to lock directory ‘C:\Users\cheol\OneDrive\문서\R\win-library\3.6’ for modifying
Try removing ‘C:\Users\cheol\OneDrive\문서\R\win-library\3.6/00LOCK’

knitr installation in R, error

I am fighting Another day with knitr installation and I can not come with new solutions. Last I deleted knitr and tried to install again. Below is a whole console from the process, what is wrong???? I got error message (see below) that is appearing everytime I start R studio and install new packages.
R version 3.1.2 (2014-10-31) -- "Pumpkin Helmet"
Copyright (C) 2014 The R Foundation for Statistical Computing
Platform: i386-w64-mingw32/i386 (32-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
[Workspace loaded from ~/2016/KNUTSTORP/.RData]
> install.packages("knitr")
Installing package into ‘\\xxxxx.xxxxx/users/Eke/mali/Documents/R/win-library/3.1’
(as ‘lib’ is unspecified)
also installing the dependencies ‘mime’, ‘stringi’, ‘magrittr’, ‘evaluate’, ‘digest’, ‘formatR’, ‘highr’, ‘markdown’, ‘stringr’, ‘yaml’
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.1/mime_0.4.zip'
Content type 'application/zip' length 37255 bytes (36 Kb)
opened URL
downloaded 36 Kb
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.1/stringi_1.0-1.zip'
Content type 'application/zip' length 14266706 bytes (13.6 Mb)
opened URL
downloaded 13.6 Mb
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.1/magrittr_1.5.zip'
Content type 'application/zip' length 152098 bytes (148 Kb)
opened URL
downloaded 148 Kb
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.1/evaluate_0.9.zip'
Content type 'application/zip' length 42030 bytes (41 Kb)
opened URL
downloaded 41 Kb
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.1/digest_0.6.9.zip'
Content type 'application/zip' length 171597 bytes (167 Kb)
opened URL
downloaded 167 Kb
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.1/formatR_1.3.zip'
Content type 'application/zip' length 52426 bytes (51 Kb)
opened URL
downloaded 51 Kb
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.1/highr_0.5.1.zip'
Content type 'application/zip' length 35546 bytes (34 Kb)
opened URL
downloaded 34 Kb
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.1/markdown_0.7.7.zip'
Content type 'application/zip' length 165447 bytes (161 Kb)
opened URL
downloaded 161 Kb
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.1/stringr_1.0.0.zip'
Content type 'application/zip' length 83256 bytes (81 Kb)
opened URL
downloaded 81 Kb
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.1/yaml_2.1.13.zip'
Content type 'application/zip' length 180080 bytes (175 Kb)
opened URL
downloaded 175 Kb
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.1/knitr_1.12.3.zip'
Content type 'application/zip' length 811552 bytes (792 Kb)
opened URL
downloaded 792 Kb
package ‘mime’ successfully unpacked and MD5 sums checked
package ‘stringi’ successfully unpacked and MD5 sums checked
package ‘magrittr’ successfully unpacked and MD5 sums checked
package ‘evaluate’ successfully unpacked and MD5 sums checked
package ‘digest’ successfully unpacked and MD5 sums checked
package ‘formatR’ successfully unpacked and MD5 sums checked
package ‘highr’ successfully unpacked and MD5 sums checked
package ‘markdown’ successfully unpacked and MD5 sums checked
package ‘stringr’ successfully unpacked and MD5 sums checked
package ‘yaml’ successfully unpacked and MD5 sums checked
package ‘knitr’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\mali\AppData\Local\Temp\RtmpwHvHGn\downloaded_packages
Error: invalid version specification ‘NA’
In addition: Warning message:
In utils:::packageDescription(packageName, fields = "Version") :
no package 'knitr' was found
The output of the version
> version
platform i386-w64-mingw32
arch i386
os mingw32
system i386, mingw32
status
major 3
minor 1.2
year 2014
month 10
day 31
svn rev 66913
language R
version.string R version 3.1.2 (2014-10-31)
nickname Pumpkin Helmet
As it was recommended I opened new session. But the Error is still the same. I tested several other packages and they work fine (i.e. nlme, lme4)
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
Error: invalid version specification ‘NA’
In addition: Warning message:
In utils:::packageDescription(packageName, fields = "Version") :
no package 'knitr' was found
[Workspace loaded from ~/R/TESTER/.RData]
What is even more strange is that knitr is somehow installed
Error: invalid version specification ‘NA’
In addition: Warning message:
In utils:::packageDescription(packageName, fields = "Version") :
no package 'knitr' was found
[Workspace loaded from ~/R/TESTER/.RData]
> library(knitr)
It does not give an error when loaded by library commend
When I install knitr in Rstudio than I got such comments
Installing packages into '\\xxx.xx/users/Eke/mali/Documents/R/win-library/3.3'
(as 'lib' is unspecified)
also installing the dependencies 'mime', 'stringi', 'magrittr', 'Rcpp'
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.3/mime_0.4.zip'
Content type 'application/zip' length 37402 bytes (36 KB)
==================================================
downloaded 36 KB
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.3/stringi_1.0-1.zip'
Content type 'application/zip' length 14302873 bytes (13.6 MB)
==================================================
downloaded 13.6 MB
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.3/magrittr_1.5.zip'
Content type 'application/zip' length 149726 bytes (146 KB)
==================================================
downloaded 146 KB
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.3/Rcpp_0.12.4.zip'
Content type 'application/zip' length 3249212 bytes (3.1 MB)==================================================
downloaded 3.1 MB
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.3/evaluate_0.9.zip'
Content type 'application/zip' length 41981 bytes (40 KB)
==================================================
downloaded 40 KB
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.3/digest_0.6.9.zip'
Content type 'application/zip' length 169286 bytes (165 KB)
==================================================
downloaded 165 KB
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.3/formatR_1.3.zip'
Content type 'application/zip' length 52656 bytes (51 KB)
==================================================
downloaded 51 KB
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.3/highr_0.5.1.zip'
Content type 'application/zip' length 35637 bytes (34 KB)
==================================================
downloaded 34 KB
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.3/markdown_0.7.7.zip'
Content type 'application/zip' length 167151 bytes (163 KB)==================================================
downloaded 163 KB
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.3/stringr_1.0.0.zip'
Content type 'application/zip' length 83315 bytes (81 KB)
==================================================
downloaded 81 KB
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.3/yaml_2.1.13.zip'
Content type 'application/zip' length 175748 bytes (171 KB)
==================================================
downloaded 171 KB
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.3/htmltools_0.3.5.zip'
Content type 'application/zip' length 571964 bytes (558 KB)==================================================
downloaded 558 KB
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.3/caTools_1.17.1.zip'
Content type 'application/zip' length 287027 bytes (280 KB)==================================================
downloaded 280 KB
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.3/bitops_1.0-6.zip'
Content type 'application/zip' length 36372 bytes (35 KB)
==================================================
downloaded 35 KB
package 'mime' successfully unpacked and MD5 sums checked
package 'stringi' successfully unpacked and MD5 sums checked
package 'magrittr' successfully unpacked and MD5 sums checked
package 'Rcpp' successfully unpacked and MD5 sums checked
package 'evaluate' successfully unpacked and MD5 sums checked
package 'digest' successfully unpacked and MD5 sums checked
package 'formatR' successfully unpacked and MD5 sums checked
package 'highr' successfully unpacked and MD5 sums checked
package 'markdown' successfully unpacked and MD5 sums checked
package 'stringr' successfully unpacked and MD5 sums checked
package 'yaml' successfully unpacked and MD5 sums checked
package 'htmltools' successfully unpacked and MD5 sums checked
package 'caTools' successfully unpacked and MD5 sums checked
package 'bitops' successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\mali\AppData\Local\Temp\RtmpeK2q5y\downloaded_packages
Installing packages into '\\xxxxx.xxxx/users/Eke/mali/Documents/R/win-library/3.3'
(as 'lib' is unspecified)
also installing the dependencies 'mime', 'stringi', 'magrittr', 'Rcpp', 'bitops', 'evaluate', 'digest', 'formatR', 'highr', 'markdown', 'stringr', 'yaml', 'htmltools', 'caTools'
trying URL 'https://cran.rstudio.com/src/contrib/mime_0.4.tar.gz'
Content type 'application/x-gzip' length 12545 bytes (12 KB)
==================================================
downloaded 12 KB
trying URL 'https://cran.rstudio.com/src/contrib/stringi_1.0-1.tar.gz'
Content type 'application/x-gzip' length 3643002 bytes (3.5 MB)==================================================
downloaded 3.5 MB
trying URL 'https://cran.rstudio.com/src/contrib/magrittr_1.5.tar.gz'
Content type 'application/x-gzip' length 200504 bytes (195 KB)==================================================
downloaded 195 KB
trying URL 'https://cran.rstudio.com/src/contrib/Rcpp_0.12.4.tar.gz'
Content type 'application/x-gzip' length 2402065 bytes (2.3 MB)==================================================
downloaded 2.3 MB
trying URL 'https://cran.rstudio.com/src/contrib/bitops_1.0-6.tar.gz'
Content type 'application/x-gzip' length 8734 bytes
==================================================
downloaded 8734 bytes
trying URL 'https://cran.rstudio.com/src/contrib/evaluate_0.9.tar.gz'
Content type 'application/x-gzip' length 19165 bytes (18 KB)
==================================================
downloaded 18 KB
trying URL 'https://cran.rstudio.com/src/contrib/digest_0.6.9.tar.gz'
Content type 'application/x-gzip' length 116746 bytes (114 KB)
==================================================
downloaded 114 KB
trying URL 'https://cran.rstudio.com/src/contrib/formatR_1.3.tar.gz'
Content type 'application/x-gzip' length 28139 bytes (27 KB)==================================================
downloaded 27 KB
trying URL 'https://cran.rstudio.com/src/contrib/highr_0.5.1.tar.gz'
Content type 'application/x-gzip' length 16744 bytes (16 KB)
==================================================
downloaded 16 KB
trying URL 'https://cran.rstudio.com/src/contrib/markdown_0.7.7.tar.gz'
Content type 'application/x-gzip' length 79427 bytes (77 KB)==================================================
downloaded 77 KB
trying URL 'https://cran.rstudio.com/src/contrib/stringr_1.0.0.tar.gz'
Content type 'application/x-gzip' length 34880 bytes (34 KB)
==================================================
downloaded 34 KB
trying URL 'https://cran.rstudio.com/src/contrib/yaml_2.1.13.tar.gz'
Content type 'application/x-gzip' length 81045 bytes (79 KB)
==================================================
downloaded 79 KB
trying URL 'https://cran.rstudio.com/src/contrib/htmltools_0.3.5.tar.gz'
Content type 'application/x-gzip' length 44048 bytes (43 KB)
==================================================
downloaded 43 KB
trying URL 'https://cran.rstudio.com/src/contrib/caTools_1.17.1.tar.gz'
Content type 'application/x-gzip' length 63358 bytes (61 KB)
==================================================
downloaded 61 KB
trying URL 'https://cran.rstudio.com/src/contrib/knitr_1.12.3.tar.gz'
Content type 'application/x-gzip' length 830827 bytes (811 KB)==================================================
downloaded 811 KB
trying URL 'https://cran.rstudio.com/src/contrib/rmarkdown_0.9.6.tar.gz'
Content type 'application/x-gzip' length 2013956 bytes (1.9 MB)==================================================
downloaded 1.9 MB
'\\xxxx.xxx\users\Eke\mali\Documents\R\TESTER'
CMD.EXE was started with the above path as the current directory.
UNC paths are not supported. Defaulting to Windows directory.
* installing *source* package 'mime' ...
** package 'mime' successfully unpacked and MD5 sums checked
** libs
*** arch - i386
Warning: running command 'make -f "C:/PROGRA~1/R/R-33~1.0/etc/i386/Makeconf" -f "C:/PROGRA~1/R/R-33~1.0/share/make/winshlib.mk" SHLIB="mime.dll" OBJECTS="rawmatch.o"' had status 127
ERROR: compilation failed for package 'mime'
* removing '\\xxxx-xxx/users/Eke/mali/Documents/R/win-library/3.3/mime'
* restoring previous '\\xxxx.xxxx/users/Eke/mali/Documents/R/win-library/3.3/mime'
'\\xxxxx.xxxx\users\Eke\mali\Documents\R\TESTER'
CMD.EXE was started with the above path as the current directory.
UNC paths are not supported. Defaulting to Windows directory.
* installing *source* package 'stringi' ...
** package 'stringi' successfully unpacked and MD5 sums checked
Warning: running command 'sh ./configure.win' had status 127
ERROR: configuration failed for package 'stringi'
* removing '\\xxxxxxx.xxxx/users/Eke/mali/Documents/R/win-library/3.3/stringi'
* restoring previous '\\xxxxx.xxxx/users/Eke/mali/Documents/R/win-library/3.3/stringi'
'\\xxxxx.xxxxxxx\users\Eke\mali\Documents\R\TESTER'
CMD.EXE was started with the above path as the current directory.
UNC paths are not supported. Defaulting to Windows directory.
* installing *source* package 'magrittr' ...
** package 'magrittr' successfully unpacked and MD5 sums checked
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
Warning in file(con, "w") :
cannot open file '\\xxxxx.xxxxxx/users/Eke/mali/Documents/R/win-library/3.3/magrittr/doc/index.html': No such file or directory
Error in file(con, "w") : cannot open the connection
ERROR: installing vignettes failed
* removing '\\xxxxx.xxxxx/users/Eke/mali/Documents/R/win-library/3.3/magrittr'
* restoring previous '\\xxxxx.xxxxxx/users/Eke/mali/Documents/R/win-library/3.3/magrittr'
'\\xxxxxx.xxxxxx\users\Eke\mali\Documents\R\TESTER'
CMD.EXE was started with the above path as the current directory.
UNC paths are not supported. Defaulting to Windows directory.
* installing *source* package 'Rcpp' ...
** package 'Rcpp' successfully unpacked and MD5 sums checked
I followed #Richie_Cotton proposal without succés
> .libPaths()
[1] "\\\\xxxxx.xxx/users/Eke/mali/Documents/R/win-library/3.3" "C:/Program Files/R/R-3.3.0/library"
> .libPaths("\\\\xxxxxx.xxx/users/Eke/mali/Documents/R/win-library/new")
> .libPaths()
[1] "\\\\xxxxxx.xxx/users/Eke/mali/Documents/R/win-library/new" "C:/Program Files/R/R-3.3.0/library"
> install.packages("knitr", dependencies = F)
Installing package into ‘\\xxxxxx.xxx/users/Eke/mali/Documents/R/win-library/new’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.3/knitr_1.12.3.zip'
Content type 'application/zip' length 812072 bytes (793 KB)
downloaded 793 KB
package ‘knitr’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\mali\AppData\Local\Temp\RtmpmwdUSv\downloaded_packages
Error: invalid version specification ‘NA’
In addition: Warning message:
In utils:::packageDescription(packageName, fields = "Version") :
no package 'knitr' was found
>
I user taceback but I do not know how to translate the result
5: stop(gettextf("invalid version specification %s", paste(sQuote(unique(x[!ok])),
collapse = ", ")), call. = FALSE, domain = NA)
4: .make_numeric_version(x, strict, .standard_regexps()$valid_package_version,
"package_version")
3: package_version(utils:::packageDescription(packageName, fields = "Version"))
2: .rs.getPackageVersion("knitr")
1: (function (markdownVersion, stitchVersion)
{
caps <- list()
caps$r_markdown_supported = .rs.scalar(FALSE)
caps$stitch_supported = .rs.scalar(FALSE)
if (.rs.isPackageInstalled("knitr")) {
knitrVersion <- .rs.getPackageVersion("knitr")
caps$r_markdown_supported = .rs.scalar(knitrVersion >=
markdownVersion)
caps$stitch_supported = .rs.scalar(knitrVersion >= stitchVersion)
}
return(caps)
})("1.2", "1.2")
>
It isn't clear from the question where things are going wrong, so you need a strategy to locate the problem. If possible, use the latest version of R for this.
When you install the packages use a fresh session. Additionally, install to a new library location so you can see exactly what is happening. You can always copy the contents of this library over to you existing library afterwards. To do this, create a new directory where you have write permissions (inside your home folder perhaps). Then when you call install.packages, use the lib.loc arguemnt to install to that location.
Rather than calling install.packages("knitr"), install each of the dependencies one by one, to see which one is causing the problem. That is, install.packages("mime"), then install.packages("stringi"), and so on. You can see the list of all the packages that you need in your question (or use packageDescription("knitr").
If you receive an error, use traceback() to see where the error occured, and include these details in your question in you need further help.
Facing the same problem, creating R_LIBS_USER in Windows environmental variables did the trick for me.
See Eric Krantz's comment here. The approach works for both Windows7 and 10.
I copied my knitr folder and its dependencies from
C:\Users\MB\Documents\R\win-library
to
C:\Program Files\R\R-4.1.3\library
Afterwards, I did not have any longer this error message :
Error: invalid version specification ‘NA’
In addition: Warning message:
In utils:::packageDescription(packageName, fields = "Version") :
no package 'knitr' was found

package "plink" is not available

Hello
When I installing plink, I get the messages.
(My version 3.1.3)
In the site, http://healthstat.snu.ac.kr/CRAN/index.html
I can not find the "plink".
How can I use "plink"?
![enter image description here][1]
You need to specify the repos argument.
> install.packages("plink", repos = "http://www2.uaem.mx/r-mirror")
Installing package into ‘C:/.../R/win-library/3.1’
(as ‘lib’ is unspecified)
also installing the dependency ‘statmod’
trying URL 'http://www2.uaem.mx/r-mirror/bin/windows/contrib/3.1/statmod_1.4.17.zip'
Content type 'application/zip' length 155890 bytes (152 KB)
opened URL
downloaded 152 KB
trying URL 'http://www2.uaem.mx/r-mirror/bin/windows/contrib/3.1/plink_1.3-1.zip'
Content type 'application/zip' length 854055 bytes (834 KB)
opened URL
downloaded 834 KB
package ‘statmod’ successfully unpacked and MD5 sums checked
package ‘plink’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\...\Local\Temp\RtmpIzfu4y\downloaded_packages
> library(plink)
Loading required package: lattice

Resources