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,
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
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
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
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