[R-sig-Geo] problems loading spproj library for transform()

Michael Sumner mdsumner at utas.edu.au
Thu May 25 07:08:11 CEST 2006


Hello

I have the same problem, I've been meaning to explore further before 
posting, but since spproj is not on CRAN I don't think I've missed 
something obvious. This seems to be related to rgdal 0.4-4:

## using data from ?project example

library(rgdal)

## project works OK
  data(state)
  res <- project(cbind(state.center$x, state.center$y), "+proj=lcc 
+lat_1=48 +lat_2=33 +lon_0=-100")
  res1 <- project(res, "+proj=lcc +lat_1=48 +lat_2=33 +lon_0=-100", 
inv=TRUE)

## but transform does not

res <- SpatialPoints(res, CRS("+proj=lcc +lat_1=48 +lat_2=33 +lon_0=-100"))

sessionInfo()
#Version 2.3.0 (2006-04-24)
#i386-pc-mingw32

#attached base packages:
#[1] "methods"   "stats"     "graphics"  "grDevices" "utils"     "datasets"
#[7] "base"    

#other attached packages:
#   rgdal   pixmap    abind       sp
# "0.4-4"  "0.4-4"  "1.1-0" "0.8-14"


transform(res, CRS("+proj=longlat"))
#Loading required package: spproj
#Error in transform(res, CRS("+proj=longlat")) :
#        for using (coordinate) transform on objects deriving from 
Spatial, library spproj is required
#In addition: Warning message:
#there is no package called 'spproj' in: library(package, lib.loc = 
lib.loc, character.only = TRUE, logical = TRUE,




More information about the R-sig-Geo mailing list