Re: [R-sig-Geo] CRAN releases of sp, rgdal and rgeos

2018-06-18 Thread MacQueen, Don via R-sig-Geo
Success! This morning I upgraded a Mac to OS 10.13.5 (the so-called High Sierra version), then - Installed R 3.5.0 from CRAN (installed ever 3.3.x) - Installed sp 1.3-1, rgdal 1.3-2, rgeos 0.3-28, also sf 0.6-3, from the CRAN binaries that are now available - Ran my personal test suite,

Re: [R-sig-Geo] help: Problem getting centroids inside lists

2018-09-10 Thread MacQueen, Don via R-sig-Geo
If all of your data frames had enough points then this should work: myfun1 <- function(le) { list(one=geosphere::centroid(coordinates(le$one)), two=geosphere::centroid(coordinates(le$two)) ) } lapply(ct, myfun1) To handle the one point case, try the following, which I think

Re: [R-sig-Geo] Using CRS() method on SpatialPointDataFrame to project coordinates

2018-09-20 Thread MacQueen, Don via R-sig-Geo
First, it looks like prcp_sites_ll does not have CRS information, because @projargs is NA. You'll need something like proj4string(prcp_sites_ll) <- CRS('+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs +towgs84=0,0,0') That string may have more than is necessary; you could also try

Re: [R-sig-Geo] Help with simple Map of US states with predefined regions Version 2

2018-09-13 Thread MacQueen, Don via R-sig-Geo
I know this is not a complete solution -- and it's a very different approach -- but it should at least show you a way to reliably get states colored by region. (I also left out Alaska and Hawaii, since the point here is how to color the regions) require(sp) require(rgdal) ## US Census Bureau

Re: [R-sig-Geo] Help with simple Map of US states to predefined regions

2018-09-13 Thread MacQueen, Don via R-sig-Geo
I know this is not a complete solution -- and it's a very different approach -- but it should at least show you one way to reliably get states colored by region. I also left out Alaska and Hawaii. require(sp) require(rgdal) ## US Census Bureau Tiger file -- polygons of each US State ## try