Following this post and also this link , I tried to update my R version .
sessionInfo()
R version 2.14.0 (2011-10-31)
Platform: i386-pc-mingw32/i386 (32-bit)
locale:
[1] LC_COLLATE=English_United States.1252
[2] LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C
[5] LC_TIME=English_United States.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] installr_0.9
loaded via a namespace (and not attached):
[1] tools_2.14.0
But when I ran the code
updateR()
Error in file(con, "r") : cannot open the connection
It shows exactly the same error while running the following command :
check.for.updates.R() # tells you if there is a new version of R or not.
Error in file(con, "r") : cannot open the connection
install.R() # download and run the latest R installer
Error in file(con, "r") : cannot open the connection
How can I update my R version ?
Per https://github.com/talgalili/installr/#troubleshooting,
Try running:
setInternet2(TRUE)
That worked for me when I was getting the below error message:
Error in file(con, "r") : cannot open the connection
The URLs of the installr package are probably out of date. Just go the R website and download the latest version.
You will have to reinstall your packages manually though, which can be a pain. You can use rownames(installed.packages()) in your old R to get a list of the packages you currently have installed so that when you go to your new R you can just work down the list and install them all again.
You could even do
sprintf('install.packages(%s)', paste(shQuote(rownames(installed.packages())),collapse=','))
and then copy-paste that command into your new R to try reinstall everything you had installed on your old R. I personally prefer though to just install them as I need them, so that if I had packages I no longer use in the old R, I don't bother to reinstall them on the new R unless I need them.
Also, the above may fail simply because your current R is quite old compared to the new R so some packages may no longer be compatible.
Related
I need a packages witch is located on Github. And I am aware that there are multiple solutions to install the package in R.
I am trying to install the package on a Windows server. This is what I tried:
Solution 1 (which is based on the Vignette)
install.packages("devtools")
library("devtools")
devtools::install_github("bmschmidt/wordVectors")
Error: Could not find tools necessary to compile a package
In addition: Warning messages:
1: In strptime(xx, f, tz = tz): unable to identify current timezone 'C':
Please set environment variable 'TZ'
I tried many things to solve this:
Reinstalling Devtools, use the CRAN devtools version
Reinstalling R and Rstudio (installing the latest versions as admin) (Error : Could not find build tools necessary to build)
But still the same error...
So I tried a workaround to install the packages on my computer:
Solution two
Download ZIP file from (https://github.com/bmschmidt/wordVectors)
Unzip the ZIP file
But the result is an error again:
library(devtools)
install("path/to/unzipped/file")
library("wordVectors")
Error there is no packages called wordVectors.
Anyone an idea what is going on? I struggled the whole day with this issue. Help is really appreciated! Thanks!
Edit
Also Rtools is (re)installed (the latest version...)
Edit 2
As requested in the comments (#DJV):
> sessionInfo()
R version 3.5.2 (2018-12-20)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows Server >= 2012 x64 (build 9200)
Matrix products: default
locale:
[1] LC_COLLATE=English_United States.1252
[2] LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C
[5] LC_TIME=English_United States.1252
attached base packages:
[1] stats graphics grDevices utils datasets
[6] methods base
loaded via a namespace (and not attached):
[1] compiler_3.5.2 tools_3.5.2
I have been using R for a while without problems. Just a sudden, i have several issues with Rjava errors. I searched online for clues, but found none.
The error is: Warning in install.packages :
package ‘rJava’ is in use and will not be installed
and now every time i run install.packages, i get a pop box that says uploading loaded packages.....
sessionInfo()
R version 3.5.2 (2018-12-20)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)
Matrix products: default
locale:
[1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252 LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C LC_TIME=English_United States.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] miniUI_0.1.1.1 tabulizer_0.2.2 rJava_0.9-10
Every time i start RStudio, i get this error:
Loading required package: rJava
Error: package or namespace load failed for ‘rJava’ in exists(what, mode = "function", envir = ns):
reached elapsed time limit
I made sure that i had java versions for 64 bit and the environment was set correctly.
install.packages("rJava");library(rJava)
I want to have a solution so that rjava loads correctly when i start RStudio or install rjava
This looks like you are loading tabulizer on startup, which also loads rJava. I suspect the reason is that you have a file called .RDATA saved in your default working environment. That makes RStudio open and load it on starting. In that file, I suspect there is an object which needs tabulizer. This is why it is loaded on default and why you have these problems.
The solution is to delete or rename the .RDATA file. Use getwd() to find out your current working directory. You might need to make hidden files visible.
I have just enough experience with R to get some things done, but not enough to actually troubleshoot a problem like this. I also would not call myself a programmer, though at some point that would be great. In case it matters, I usually use Rstudio.
I am trying to solve a problem where I have different entries for the same sample (microsatellites with different runs) that I need to condense into one line of information for each sample. I found the perfect package to solve my problem (package = genomatic). The trouble is, that I could not install it for use with the most recent version of R because it was created before version 3.0. So I downloaded version 2.15.3 and am working with the regular bare bones console.
Genomatic was not available through the install packages list, so I downloaded a zip file for Windows from here: http://www2.uaem.mx/r-mirror/web/packages/genomatic/index.html
and then followed the directions from pages 6-7 in the manual (link below) to install it from my own machine.
http://people.oregonstate.edu/~knausb/software/Genomatic_users_manual_v05.pdf
It appeared to install just fine, however when I go to load the library, I get the following error:
> library(genomatic)
Loading required package: tcltk
Loading Tcl/Tk interface ... done
Error in library(genomatic) :
package ‘genomatic’ does not have a NAMESPACE and should be re-installed
I looked through the forum, but could not find an answer for how to fix this. Here is the session info:
> sessionInfo()
R version 2.15.3 (2013-03-01)
Platform: x86_64-w64-mingw32/x64 (64-bit)
locale:
[1] LC_COLLATE=English_United States.1252
[2] LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C
[5] LC_TIME=English_United States.1252
attached base packages:
[1] tcltk stats graphics grDevices utils datasets methods
[8] base
Can somebody help me to make this work?
Thanks!
Liz
EDIT to add: I did try to reinstall, but ended up with the same results.
I'm not sure why you're getting this particular error, as the .zip file provided does appear to have a NAMESPACE file. Installing from source (which shouldn't require any extra installed tools, since the package has only R code, not any compiled [C++/C/FORTRAN] components) seems to help. You can either do this from the official CRAN archives:
library("devtools")
install_version("genomatic",version="0.0.7")
or from the old/frozen repository:
install.packages("genomatic",
repos="http://www2.uaem.mx/r-mirror/", type="source")
(My previous answer was wrong; there is a NAMESPACE file.)
I am having trouble running Rcpp on my PC in RStudio. Whenever I sourceCpp() a cpp file, even the Hello World file that comes with Rcpp::Rcpp.package.skeleton(), I get the warning
In normalizePath(path.expand(path), winslash, mustWork) :
path[1]=".../anRpackage/src/../inst/include": The system cannot find the path specified
I searched Stackoverflow and it looks like some people get this warning if they don't have Depends: Rcpp in the DESCRIPTION of their package, but I am just running sourceCpp() so the DESCRIPTION file shouldn't matter (I also changed my DESCRIPTION file).
It is just a warning so the class and functions I wrote do appear in R, but RStudio frequently crashes after I use the functions in R a few times, which may or may not be related.
My session info:
R version 3.1.3 (2015-03-09)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 8 x64 (build 9200)
locale:
[1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252 LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C LC_TIME=English_United States.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] Rcpp_0.12.1 RevoUtilsMath_7.4.1 RevoUtils_7.4.1 RevoMods_7.4.1 RevoScaleR_7.4.1 lattice_0.20-30 rpart_4.1-9
loaded via a namespace (and not attached):
[1] codetools_0.2-10 foreach_1.4.2 grid_3.1.3 iterators_1.0.7 tools_3.1.3
I suppose it is possible that Revolution R is the culprit here, but I have no way of knowing. I would appreciate help, because I don't want to ignore this warning, and it's obviously not ideal for RStudio to crash repeatedly.
Kind Regards
This is still relevant today, so here's my discoveries.
Rcpp can generate interfaces to and from C++ and R.
These are generated with the help of attributes specified in source-files.
From these attributes, the call to Rcpp::compileAttributes() produces the headers. Whilst at it, this also create the folder <package directory>/inst/include. If you have specified no attributes, anywhere, then compileAttributes() does not create these directories.
In order to get rid of this warning, create the <package directory>/inst/include.
For more on attributes, see Rcpp attributes vignette.
Out of the blue my devtools package will not work. Here is what I get. I have tried numerous fixes on my Windows 8 machine. I have reinstalled Rtools, I have reinstalled devtools but I keep getting the follwoing
require(devtools)
Loading required package: devtools
Error in namespaceExport(ns, exports) :
undefined exports: iteratelist, rowSplit, whisker.escape, whisker.render
Where do I begin?
Winston Chang over on the devtools github said, "Strange, those errors involve the whisker package." So at his behest I am providing some additional information.
> packageVersion('whisker')
[1] ‘0.3.2’
> packageVersion('devtools')
[1] ‘1.3’
> sessionInfo()
R version 3.0.1 (2013-05-16)
Platform: x86_64-w64-mingw32/x64 (64-bit)
locale:
[1] LC_COLLATE=English_United States.1252
[2] LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C
[5] LC_TIME=English_United States.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
I found a solution. I deleted the whisker folder in ~My Documents\R\win-library\3.0\ and reinstalled the package. Everything worked.
Thanks to Winston Chang who made me realize that my devtools problems were coming from the whisker package which I believe devtools relies on. Thank you to #DWin who gave me the idea of chucking out a malfunctioning library and reinstalling the library.
It was when I issued library(whisker) that I realized the problem may not be with devtools at all but rather with whisker
> library(whisker)
Error in namespaceExport(ns, exports) :
undefined exports: iteratelist, rowSplit, whisker.escape, whisker.render
Error: package or namespace load failed for ‘whisker’
I can now load devtools and whisker.
It is odd. I would have thought that my packages would have been reinstalled when I uninstalled R and reinstalled it (one of the desperate steps I took when I was trying to troubleshoot). Evidently ~My Documents\R\win-library\3.0\whisker survived the uninstallation. Clearly I need to learn more about R installation and the ways in which the libraries can be setup.
My guess, in the absence of complete information and a log file for a command line installation, is that you have a corrupt .RData file. The .Rhistory file might alos be a source of corrupted data that results in incomprehensible error messages. (They are invisible to the average R user on both Windows and Mac file browsers.) Windows Explorer let's you choose to show hidden files. In WinXP one of the choices off the "Folder Options" dialog is the "View" panel. Delete first the .Rdata file and if that doesn't work then also delete the .Rhistory file.
My guess was wrong, so if RTools is available then:
install.packages("RGoogleDocs",
repos="http://www.omegahat.org/R", type="source")