Installing GIS tools in R - 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.

Related

browseVignettes not returning anything for ggplot2 package in R - No error message

I'm very new to R and recently installed R-studio. I'm trying to familiarize myself with packages by using browseVignettes() but it isn't returning anything for the package ggplot2, which I know contains vignettes from a tutorial video.
When I try using browseVignettes with certain packages in the system library, I receive an error message, e.g.:
> browseVignettes("stats")
No vignettes found by browseVignettes("stats")
By contrast, I receive no error message when attempting to access the vignettes of ggplot2.
My theory is that I installed the package incorrectly. When I went through the installation, I received the below message.
> install.packages("ggplot2")
Installing package into ‘C:/Users/micha/Documents/R/win-library/4.0’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.0/ggplot2_3.3.0.zip'
Content type 'application/zip' length 4015425 bytes (3.8 MB)
downloaded 3.8 MB
package ‘ggplot2’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\micha\AppData\Local\Temp\RtmpyYnCz3\downloaded_packages
Any assistance would be much appreciated, as I am hoping to be able to review these vignettes and avoid this error repeating itself next time I install a package from CRAN.
Welcome to R. There is a bit of a learning curve, but it is very powerful once you get the hang of it.
The installation of ggplot2 looks like it went according to plan. One way to check is to run library(ggplot2) in the console. If you do not get an error then it is installed correctly.
browseVignettes("ggplot2") should open a browser window with a list of the available vignettes (only 3 in this case). It does so silently, so that is why you did not get a message–error or otherwise.
Not all packages have vignettes, as you have already discovered with the "stats" package.
Incase anyone else comes across this looking for the answer...
Have you ever seen the term smart quotes as opposed to straight quotes...
it's the "" used in the original, they are smart quotes (curved). Delete them and re add them in R. Where ever they are being copied from they are not coming into R as straight quotes, thus they are not recognized.
Once they have been changed to straight quotes the command will run.
Hope this helps those coming after....

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

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)

Error in loadNamespace Rstudio

I am having real trouble understanding what my problem is installing ggplot package in Rstudio. I have tried a number of the post here and here but I still can't fix the problem.
I understand that I have a library directory on my Windows machine which can be found using:
.libPaths() which returns
[1] "C:/Users/Bo Bo/Documents/R/win-library/3.2" "C:/Program Files/R/R-3.2.3/library"
I'm not sure what is stored in this directory using .Library but it looks to be pointing to the wrong directory, 3.2.3 and 32~1.3???:
[1] "C:/PROGRA~1/R/R-32~1.3/library"
Upon installing ggplot2
install.packages("ggplot2") returns:
Installing package into ‘C:/Users/Bo Bo/Documents/R/win-library/3.2’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.2/ggplot2_2.1.0.zip'
Content type 'application/zip' length 2001769 bytes (1.9 MB)
downloaded 1.9 MB
package ‘ggplot2’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\Bo Bo\AppData\Local\Temp\Rtmp4QKdwV\downloaded_packages
So is it dumping the package in a temp directory because the 'lib' is unspecified? If so how do I specify the 'lib' and which library needs to change.
By the way I followed #Paweł Rumian post in link 2 above meaning I have a new User variable called R_LIBS_USER pointing to C:/Program Files/R/R-3.2.3/library
Can anyone make a suggestion as to how I can resolve this conflict and move on with my life :)
So I ended up re-installing windows after hours of trying to modify/fix the permissions issue I was having with all folders on the local disk.
Since re-installing I have installed Rstudio as per before and I am back in business, no messing around with library locations, just plain vanilla for me please...

Installing ZeligMultilevel. Error : object ‘describe’ is not exported by 'namespace:Zelig'

I am trying to use ZeligMultilevel but I am having problems when opening the library. Please, see below:
> install.packages("ZeligMultilevel")
trying URL
'http://cran.rstudio.com/bin/windows/contrib/3.2/ZeligMultilevel_0.7-1.zip'
Content type 'application/zip' length 267971 bytes (261 KB) downloaded
261 KB
package ‘ZeligMultilevel’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\AppData\Local\Temp\RtmpkHO9ls\downloaded_packages
> library(ZeligMultilevel)
Error : object ‘describe’ is not exported by 'namespace:Zelig'
Error:package or namespace load failed for ‘ZeligMultilevel’
I already tried installing it with dependencies=TRUE. I also tried installing ZeligMultilevel from the source and I have the same problem. I think there must be a tiny silly thing that I am missing, but I cannot find what to do...
Any idea?
Thanks
It looks like there is a compatibility problem between the latest version of the Zelig package and ZeligMultilevel. Notice that the latest version of Zelig was uploaded about a week ago.
Try downloading an older version of Zelig and installing that.
https://cran.r-project.org/src/contrib/Archive/Zelig/
Installing the Zelig_4.2-1.tar.gz from the 21-Sep-2013 worked for me.

R not finding package even after package installation

I have always worked with the zoo package, that I have installed a long time ago. Today, I created a new R script, and ran library(zoo) and got the following error:
> library(zoo)
Error in library(zoo) : there is no package called ‘zoo’
Odd.. Still, I tried reinstalling the package using install.packages("zoo"), and get the following:
> install.packages("zoo")
Installing package(s) into ‘C:/Users/U122337.BOSTONADVISORS/Documents/R/win-library/2.15’
(as ‘lib’ is unspecified)
--- Please select a CRAN mirror for use in this session ---
trying URL 'http://cran.cnr.Berkeley.edu/bin/windows/contrib/2.15/zoo_1.7-10.zip'
Content type 'application/zip' length 874474 bytes (853 Kb)
opened URL
downloaded 853 Kb
package ‘zoo’ successfully unpacked and MD5 sums checked
Warning: cannot remove prior installation of package ‘zoo’
The downloaded binary packages are in
C:\Users\U122337.BOSTONADVISORS\AppData\Local\Temp\Rtmp404t8Y\downloaded_packages
When I try uploading the package, I get the error again that the zoo package doesn't exist.
I have no idea what's happening. I exited the GUI and restarted it, same problem. I have always worked with this package, and I have no idea why this is happening now.
Do .libPaths(), close every R runing, check in the first directory, remove the zoo package restart R and install zoo again. Of course you need to have sufficient rights.
When you run
install.packages("whatever")
you got message that your binaries are downloaded into temporary location (e.g. The downloaded binary packages are in
C:\Users\User_name\AppData\Local\Temp\RtmpC6Y8Yv\downloaded_packages ). Go there. Take binaries (zip file). Copy paste into location which you get from running the code:
.libPaths()
If libPaths shows 2 locations, then paste into second one. Load library:
library(whatever)
Fixed.
I had this problem and the issue was that I had the package loaded in another R instance. Simply closing all R instances and installing on a fresh instance allowed for the package to be installed.
Generally, you can also install if every remaining instance has never loaded the package as well (even if it installed an old version).
So the package will be downloaded in a temp folder C:\Users\U122337.BOSTONADVISORS\AppData\Local\Temp\Rtmp404t8Y\downloaded_packages from where it will be installed into your library folder, e.g. C:\R\library\zoo
What you have to do once install command is done: Open Packages menu -> Load package...
You will see your package on the list. You can automate this:
How to load packages in R automatically?
go to this folder C:\Users\hp\Documents\R\win-library\4.0 in your PC.
And delete '00LOCK' named folder.
then It will work properly, THis folder is being locked all incoming file.IF your delete this , then it will work.

Resources