0

when i am trying to install "SpatialPostion" for R in jupyter notebook with following method:

install.packages("SpatialPosition_2.0.1.tar.gz",repos=NULL,type="source")
options(unzip='internal')
library(SpatialPosition)

tried with Zip file also (Cran site i am not able to access due to some security issue), i am getting this error :

Error in library(SpatialPosition): there is no package called ‘SpatialPosition’
Traceback:
1. library(SpatialPosition)
2. stop(txt, domain = NA)**

I tried lot possible combination given here , but still getting same error all time .hope i will get appropriate solution from you guys which can run successfully .Thanks

mysteRious
  • 4,102
  • 2
  • 16
  • 36
  • Have you tried installing `remotes` package and then `remotes::install_github("Groupe-ElementR/SpatialPosition")`? – mysteRious May 09 '20 at 02:24
  • hey @mysteRious it is showing : "Error: Failed to install 'SpatialPosition' from GitHub: (converted from warning) installation of package ‘units’ had non-zero exit status" – Minali19 May 11 '20 at 05:48

1 Answers1

0

This installation procedure (which does not attempt to get or unzip a gz) was successful. If you try this from a fresh R session and it still does not work, perhaps try an earlier version of R (this is on 3.6.3). I can confirm that the package is available from github and not corrupted:

> install.packages("remotes")
> library(remotes)
> remotes::install_github("Groupe-ElementR/SpatialPosition")
Downloading GitHub repo Groupe-ElementR/SpatialPosition@master
These packages have more recent versions available.
It is recommended to update all of them.
Which would you like to update?

1: All                                
2: CRAN packages only                 
3: None                               
4: Rcpp      (1.0.3 -> 1.0.4.6) [CRAN]
5: rlang     (0.4.5 -> 0.4.6  ) [CRAN]
6: withr     (2.1.2 -> 2.2.0  ) [CRAN]
7: pkgbuild  (1.0.6 -> 1.0.8  ) [CRAN]
8: backports (1.1.5 -> 1.1.6  ) [CRAN]
9: ps        (1.3.2 -> 1.3.3  ) [CRAN]

Enter one or more numbers, or an empty line to skip updates:

Installing 4 packages: sf, rgeos, raster, units
Installing packages into ‘C:/Users/User/Documents/R/win-library/3.6’ (as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.6/sf_0.9-3.zip'
Content type 'application/zip' length 42626142 bytes (40.7 MB)
downloaded 40.7 MB

trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.6/rgeos_0.5-3.zip'
Content type 'application/zip' length 2030318 bytes (1.9 MB)
downloaded 1.9 MB

trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.6/raster_3.1-5.zip'
Content type 'application/zip' length 3344411 bytes (3.2 MB)
downloaded 3.2 MB

trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.6/units_0.6-6.zip'
Content type 'application/zip' length 1759033 bytes (1.7 MB)
downloaded 1.7 MB

package ‘sf’ successfully unpacked and MD5 sums checked
package ‘rgeos’ successfully unpacked and MD5 sums checked
package ‘raster’ successfully unpacked and MD5 sums checked
package ‘units’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in
C:\Users\User\AppData\Local\Temp\RtmpaGI1w7\downloaded_packages
√  checking for file 
'C:\Users\User\AppData\Local\Temp\RtmpaGI1w7\remotes8a0416e2c30\Groupe-ElementR-SpatialPosition-e425314/DESCRIPTION' ...
-  preparing 'SpatialPosition':
√  checking DESCRIPTION meta-information ... 
-  checking for LF line-endings in source and make files and shell scripts
-  checking for empty or unneeded directories
-  looking to see if a 'data/datalist' file should be added
-  building 'SpatialPosition_2.0.1.tar.gz'

Installing package into ‘C:/Users/User/Documents/R/win-library/3.6’
(as ‘lib’ is unspecified)
* installing *source* package 'SpatialPosition' ...
** using staged installation
** R
** data
*** moving datasets to lazyload DB
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
  converting help for package 'SpatialPosition'
    finding HTML links ... done
    CreateDistMatrix                        html  
    CreateGrid                              html  
    SpatialPosition                         html  
    hospital                                html  
    huff                                    html  
    isopoly                                 html  
    mcStewart                               html  
    paris                                   html  
    plotHuff                                html  
    plotReilly                              html  
    plotStewart                             html  
    quickStewart                            html  
    rasterHuff                              html  
    rasterReilly                            html  
    finding level-2 HTML links ... done

    rasterStewart                           html  
    rasterToContourPoly                     html  
    reilly                                  html  
    smoothy                                 html  
    spatMask                                html  
    spatPts                                 html  
    spatUnits                               html  
    stewart                                 html  
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (SpatialPosition)
> library(SpatialPosition)
> 

This was successfully installed with this sessionInfo():

> sessionInfo()
R version 3.6.3 (2020-02-29)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 18362)

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    
mysteRious
  • 4,102
  • 2
  • 16
  • 36
  • hi @mysteRious , Azure jupyter notebook i am using have 3.5.3 Version of R . when i am trying to install 'Remotes ' it is showing : “package ‘remotes’ is not available (for R version 3.5.3)” and when i run 'remotes::install_github("Groupe-ElementR/SpatialPosition").. got error : 'Error: Failed to install 'unknown package' from GitHub'.... so is it the issue of R version ?? and apart from 3.6.3 which version support it . ? – Minali19 May 14 '20 at 14:39
  • this might help: https://stackoverflow.com/questions/25721884/how-should-i-deal-with-package-xxx-is-not-available-for-r-version-x-y-z-wa – mysteRious May 14 '20 at 14:40