Can't load geoR package (R, library()) - r

for a project in university, I need to install a package which depends on geoR. Unfortunately, I can't load the package with library(geoR). The installation is not a problem. I've tried to uninstall and install the package and updated R. It still loads "forever". It is particularly strange since I can easily load any other installed package with library(...). Since I don't get any error message in the console, I'm very frustrated and have no idea how to solve that issue. I use Mac OS X 10.14.4. I'm using RStudio Version 1.1.463.
The installation seems to be no problem:
> install.packages("geoR")
trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.5/geoR_1.7-5.2.1.tgz'
Content type 'application/x-gzip' length 1544028 bytes (1.5 MB)
==================================================
downloaded 1.5 MB
The downloaded binary packages are in
/var/folders/cn/p44ynxg91mq7_ld8qrllxtx80000gn/T//RtmpGJbn5O/downloaded_packages
> library(geoR)
After the library-call, a never-ending process starts. Is there a way to track the library call? I haven't found any proper solution online. Since it loads forever, the only thing I can do is to force quit R Studio. I've tried to load it in R as well, didn't work either. I've also tried to delete the (installed geoR)-folder manually in library/Frameworks/r.framework/..., it didn't help as well.

Try installing an older version using devtools:
remove.packages("geoR")
install.packages("devtools")
require(devtools)
install_version("geoR", version = "1.7-4.1", repos = "http://cran.r-project.org")
options(gsubfn.engine = "R")
library(geoR, verbose = TRUE)

Related

Error in library(ggplot2) : there is no package called ‘ggplot2’ Execution halted

I updated my system from ubuntu 18.04 to 18.10. everything worked fine on my previous version, but updating removed all my R libraries.
I want to reinstall them, but when I try and install anything, i.e.
install.packages("data.table")
Installing package into ‘/home/sam/R/x86_64-pc-linux-gnu-library/3.5’
(as ‘lib’ is unspecified)
trying URL 'http://cran.revolutionanalytics.com/src/contrib/data.table_1.11.8.tar.gz'
Content type 'application/octet-stream' length 3262853 bytes (3.1 MB)
==================================================
downloaded 3.1 MB
Error in library(ggplot2) : there is no package called ‘ggplot2’
Execution halted
The downloaded source packages are in
‘/tmp/RtmpYnxoaQ/downloaded_packages’
Warning message:
In install.packages("data.table") :
installation of package ‘data.table’ had non-zero exit status
I get some error about ggplot2 not being present, even though i'm not trying to install it. Currently I haven't managed to isntall any libraries.
I am using R version 3.5.1 (2018-07-02) -- "Feather Spray". which is the most recent version.
Any idea why this is happening?
#Roland was correct - the issue here was that I was trying to load libraries from my .Rprofile that weren't installed. Removing these lines from the .Rprofile stopped the error message.
You need to update your R version and do this but you'll need install all packages again:
Tool > Global Options > R version (CHANGE) > Select "Use your machine's default version of R..."
I did two things and it's work. Hopefully, it does for you also
a) Update your R and do this.
Tool > Global Options > R version (CHANGE) > Select "Choose the specific version of R...". Mostly just choose the latest version.
b) Restart your app after.
Install ggplot2 using this command:
install.packages("ggplot2", dependencies = TRUE)
library(ggplot2)

Installing GIS tools in R

I am trying to download GIStools in R. I did this through the Packages menu > Install Packages. I then selected GIStools and it appears to have installed it as I get the following message:
> utils:::menuInstallPkgs()
trying URL 'https://mirrors.ebi.ac.uk/CRAN/bin/windows/contrib/3.2/GISTools_0.7-4.zip'
Content type 'application/zip' length 3460038 bytes (3.3 MB)
downloaded 3.3 MB
package ‘GISTools’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\MachineX\AppData\Local\Temp\RtmpCCEk3L\downloaded_packages
I didn't select a mirror site from which to d/l the package (was it supposed to prompt me?) When I call the library using library(GIStools) I get the following error:
Error in library(GIStools) : there is no package called ‘GIStools’
I'm not sure what I have done wrong - can anyone help? I am using R version 3.2.3. I am totally new to R, so apologies if this seems like a silly question.
Thanks!
in the console type install.packages('GIStools') make sure you are running rstudio as admin when doing this. This should install just fine make sure you don't have the rstudio screen maximized as the mirror prompt could be hidden.

Installing packages from source fails with "unexpected $end" error

This one is killing me:
Problem: I can't install any packages in R from source code using standard repositories.
install.packages("quantreg", type="source")
Installing package into ‘/Users/foo/Library/R/3.0/library’
(as ‘lib’ is unspecified)
trying URL 'http://cran.wustl.edu/src/contrib/quantreg_5.05.tar.gz'
Content type 'application/x-gzip' length 1636075 bytes (1.6 Mb)
opened url
downloaded 1.6 Mb
Error: 1:5: unexpected $end
Execution halted
The downloaded source packages are in
‘/private/var/folders/h3/yfhgnv7n5gq84ly4kr6334gr0000gn/T/Rtmp3kothF/downloaded_packages’
Warning message:
In install.packages("quantreg", type = "source") :
options("unzip")
$unzip
[1] "internal"
Details
OS: OSX.9
I made a clean install of Mavericks and installed Xcode 5 + command line tools.
R: 3.0.2 installed from CRAN binary
I realize that I could install binary packages for "quantreg", but that's not the point.
Question: How can I fix this?
I've tried:
installing R from source (actually, this is how I first noticed the problem)
1b. installing R from source using clang and clang++
modifying /Library/Frameworks/R.framework/Versions/3.0/Resources/etc/Makeconf file to change CC and CXX to clang, clang++
Voodoo
Obviously, none of these things worked for me. Am I just doing something naively stupid? Use small words in simple sentences, please.
UPDATE:
Using the r-sig-mac archives, there was some stuff that was appropriate regarding the incredible, dissapearing GNUTAR. I also found on my own some problems with the gfortran call. I made some headway (but still not solved) by adding the following lines to my "/Users/foo/.R/Makevars" file
TAR=/usr/bin/tar
FC=/usr/local/bin/gfortran
F77=/usr/local/bin/gfortran
FLIBS = -L/usr/local/lib/gcc/i686-apple-darwin8/4.2.3/x86_64 -L/usr/local/lib/x86_64 -L/usr/local/lib/gcc/i686-apple-darwin8/4.2.3
Note that this removes the "-lgfortran" option from FLIBS.
Now, the packages will install using R CMD INSTALL /path/to/source.tar.gz (which is new), but still won't work using my original command in R.

R Newbie Confused about Install Packages

I am somewhat new to R, and I thought I understood how to install packages from CRAN mirrors and from source files, but now I am stumped. I currently am using R 2.10.0 on a Windows 7 32-bit machine.
I want to try to use the RGoogleAnalytics package found here and am trying to follow the instructions. They instruct us to install both RCurl and the XML packages from omegahat. For example,
install.packages("RCurl", repos = "http://www.omegahat.org/R")
however this does not work, as I get the following error:
Warning message:
In getDependencies(pkgs, dependencies, available, lib) :
package ‘RCurl’ is not available
When I try this instead:
install.packages("RCurl", repos = "http://www.omegahat.org/R", type="source")
I get the following error after the file downloads. I previously had version 1.0 and that is restored.
trying URL 'http://www.omegahat.org/R/src/contrib/RCurl_1.5-0.tar.gz'
Content type 'application/x-gzip' length 735041 bytes (717 Kb)
opened URL
downloaded 717 Kb
* installing *source* package 'RCurl' ...
Warning in system("sh ./configure.win") : sh not found
ERROR: configuration failed for package 'RCurl'
* removing 'C:/PROGRA~1/R/R-210~1.0/library/RCurl'
* restoring previous 'C:/PROGRA~1/R/R-210~1.0/library/RCurl'
The downloaded packages are in
‘C:\Users\Brock\AppData\Local\Temp\Rtmpc9wt5N\downloaded_packages’
Warning message:
In install.packages("RCurl", repos = "http://www.omegahat.org/R", :
installation of package 'RCurl' had non-zero exit status
Without going into details, I haven't been able to use the RGoogleAnalytics package as I get the same error that is found in this post. I simply am trying to exhaust every possible option to get around the error.
Any help or insight you can provide will be greatly appreciated!
The RCurl project page on CRAN says the Windows binary is not available. The ReadMe points you to a page maintained by Professor Ripley, where he provides binaries of RCurl and several other packages that have special build needs on Windows. However, he only provides them for the most recent major revision of R, so you would need to upgrade to R-2.12.0 to install them from his page.
If you want to build packages from source on Windows, you need to install Rtools first. It looks like you haven't done that. Even if you had them installed, it will still require extra steps to build RCurl on Windows... else the Windows binary would already be on CRAN.
Your best bet is probably to upgrade R and install RCurl from Prof. Ripley's page.
You are probably missing the components to build packages under Windows:
http://www.murdoch-sutherland.com/Rtools/
According to RCurl FAQ, either
curl-config is not found in your path
or
curl-config and related devlopment libraries (libcurl) are not installed.

Can install, but can't access, the pwr package in R

I'm having trouble getting access to the pwr. This is on Ubuntu Lucid Lynx, 64 bit.
I'm installing pwr via packages.install('pwr'), and loading it via library(pwr), both of which appear successful.
Strangely, I never get access to the pwr object in R.
I tried installing it to /usr/local/lib/R/site-library and ~/R/x86_64-pc-linux-gnu-library.
I also tried installing it with R CMD INSTALL pwr.
I have also tried installing it on my mac mini running Leopard but it can't even find the packages object, and CMD INSTALL pwr returns
invalid package 'pwr'
What am I doing wrong? Thanks!
Not quite right. It is installed as "pwr" and loaded as such:
> install.packages("pwr", depend = TRUE)
trying URL 'http://cran.uk.r-project.org/src/contrib/pwr_1.1.1.tar.gz'
Content type 'application/x-gzip' length 7915 bytes
opened URL
==================================================
....
> require(pwr)
Loading required package: pwr
> help(package = "pwr")
The output from the last command there shows that there doesn't appear to be a power() in that package. What you've seen is the power() function in the stats package, one of the packages that comes with R. Try ?power and look at the very top of the help page. It states "package:stats".
Furthermore, packages.install() is not a function that me R knows about. I think you meant install.packages()?
To summarise. Install the packages using this from within R (if you have a net connection):
install.packages("pwr")
Then load the package:
require("pwr")
Then you can start using it.

Resources