Subscribe to R-sig-geo feed
This is an archive for R-sig-geo, not a forum. It is not possible to post through Nabble - you may not start a new thread nor follow up an existing thread. If you wish to post, but are not subscribed to the list through the list homepage, subscribe first (through the list homepage, not via Nabble) and post from your subscribed email address. Until 2015-06-20, subscribers could post through Nabble, but policy has been changed as too many non-subscribers misunderstood the interface.
Updated: 14 min 23 sec ago

Re: Subsetting dataframe by all factor levels

Fri, 09/14/2018 - 17:54
On Fri, 14 Sep 2018, Justin H. wrote:

> I'm not sure how it handles your date format. It's probably grouping
> things weirdly. If you can split out that column into two columns, one for
> year and one for month. I'd have to tinker with it later as I can't think
> of code off the top of my head. It should play nicer then.

Justin,

   The rainfall data.frame structure:
'data.frame':   113569 obs. of  6 variables:
  $ name    : Factor w/ 58 levels "Blazed Alder",..: 20 20 20 20 20 20 20 20 ...
  $ easting : num  2370575 2370575 2370575 2370575 2370575 ...
  $ northing: num  199338 199338 199338 199338 199338 ...
  $ elev    : num  228 228 228 228 228 228 228 228 228 228 ...
  $ sampdate: Date, format: "2005-01-01" "2005-01-02" ...
  $ prcp    : num  0.59 0.08 0.1 0 0 0.02 0.05 0.1 0 0.02 ...

After splitting by name (only the first one shown):
str(rainfall_by_site)
List of 58
  $ Blazed Alder                 :'data.frame':      4900 obs. of  6 variables:
   ..$ name    : Factor w/ 58 levels "Blazed Alder",..: 1 1 1 1 1 1 1 1 1 1 ...
   ..$ easting : num [1:4900] 2393589 2393589 2393589 2393589 2393589 ...
   ..$ northing: num [1:4900] 196841 196841 196841 196841 196841 ...
   ..$ elev    : num [1:4900] 1112 1112 1112 1112 1112 ...
   ..$ sampdate: Date[1:4900], format: "2005-01-01" "2005-01-02" ...
   ..$ prcp    : num [1:4900] 0.2 0.2 0.4 0 0 0 0.1 0.1 0.1 0.2 ...

Adding a year column to the end:
     $ year    : num  0 0 0 0 0 0 0 0 0 0 ...

I've not separated the sampdate structure into years and months; I can and
that might make the difference. Will try to find time this weekend to do so.
Otherwise, it'll be next week.

Regards,

Rich

_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

Re: Subsetting dataframe by all factor levels

Fri, 09/14/2018 - 17:19
On Fri, 14 Sep 2018, Justin H. wrote:

> For the sake of example, here's a solution for a simple aggregation.
> rainfall.year<-with(rainfall, tapply(prcp, list(name, year), mean))  #This
> does the aggregation.

Justin,

   The results have sites with 'NA' for the mean precipiation despite having
recorded values some days. For example,

> rainfall.year
                                            0
Blazed Alder                              NA

while

> head(rainfall_by_site[[1]])
              name easting northing   elev   sampdate prcp
7741 Blazed Alder 2393589 196840.8 1112.5 2005-01-01  0.2
7742 Blazed Alder 2393589 196840.8 1112.5 2005-01-02  0.2
7743 Blazed Alder 2393589 196840.8 1112.5 2005-01-03  0.4
7744 Blazed Alder 2393589 196840.8 1112.5 2005-01-04  0.0
7745 Blazed Alder 2393589 196840.8 1112.5 2005-01-05  0.0
7746 Blazed Alder 2393589 196840.8 1112.5 2005-01-06  0.0

   I'll read up on tapply and see if I can identify the reason for the
discrepancy.

Regards,

Rich

_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

Re: st_union crashes RStudio - bug?

Fri, 09/14/2018 - 15:20
The in-flight analysis shows that the precision model interacts with the
geojson text representation of coordinates. I tried to use st_precision
without success. Using:

library(rgdal)
library(rgeos)
test1 <- readOGR("Australia.geojson")
setScale(4e+4)
crash1 <- gUnaryUnion(test1)
plot(crash1)
length(slot(slot(crash1, "polygons")[[1]], "Polygons"))
areas <- sapply(slot(slot(crash1, "polygons")[[1]], "Polygons"), slot,
"area")
head(sort(areas), n=10)
which(areas < 5e-8)
Pols <- slot(slot(crash1, "polygons")[[1]], "Polygons")
Pols1 <- Pols[-which(areas < 5e-8)]
slot(slot(crash1, "polygons")[[1]], "Polygons") <- Pols1
plot(crash1)

and changing scale to 4e+4 in rgeos notation, most of the remnant boundary
artefacts are removed. You can even remove the three dots in south-east
Australia. So: if you want to operations other than visualisation, avoid
geojson. If you can't avoid geojson, don't be surprised by topological
issues. Further, do use a vector representation suited to your purpose -
this one has far too much detail.

Roger

PS. Not tried on Windows - can someone please check that this doesn't
misbehave on the OP's platform?

On Fri, 14 Sep 2018, Roger Bivand wrote:

> (from an airport)
>
>> crash <- st_union(noACT)
>
> completed without error, test also passes. Your problem is not general
>
> There is absolutely no need to use ggplot to display the geometries, by
> the way.
>
> plot(st_geometry(crash))
>
> shows errant partial boundaries, probably caused by the default
> precision model and geojson's character representation of numbers.
>
> Roger
>
> Roger Bivand
> Norwegian School of Economics
> Bergen, Norway
>
>
>
>
> On Fri, Sep 14, 2018 at 7:00 PM +0200, "Roger Bivand" <[hidden email]<mailto:[hidden email]>> wrote:
>
>
> On Fri, 14 Sep 2018, Roman Luštrik wrote:
>
>> Crashes R or Rstudio?
>
> I guess the OP will get up sometime soon; of course one should always run
> R in a console, not RStudio when reporting issues of this kind. Further,
> one should run R -d gdb (if possible - see RW FAQ) to trap any important
> information. I can see that crash <- st_union(noACT) is long-running, with
> one thread at 100%, but no obvious memory issues (Fedora 28, sf 0.6-3,
> GEOS 3.7.0). It would further make sense to go the sp/rgeos route to see
> if it is data+GEOS or that the behavious is R-implementation dependent.
>
> Roger
>
>>
>> Cheers,
>> Roman
>>
>> On Fri, Sep 14, 2018 at 8:33 AM Bertram Ostendorf <
>> [hidden email]> wrote:
>>
>>> I am trying to dissolve internal boundaries using sf.  This crashes R in
>>> the example geojson map below, a simple map of Australia’s states and
>>> territories. I am using a polygon layer that processes fine in other GIS
>>> and also works fine using sp (casting to sp and using gUnaryUnion).  I am
>>> not after a workaround but I'd like to explore what's different in sf and
>>> why this particular layer causes problems.
>>>
>>> My questions: Is this a bug in sf? Have others experienced similar issues
>>> using simple features?
>>>
>>> Thanks
>>>
>>> Bertram Ostendorf
>>> Chair for Spatial Environmental Sciences
>>> Director: Spatial Information Group
>>> The University of Adelaide, AUSTRALIA 5005
>>>
>>>
>>> # Here's my example layer and code:
>>> # Note: Neither ArcGIS ‘repair geometry’ nor  ‘st_is_valid’ show any
>>> issues.
>>> library(sf)
>>> library(ggplot2)
>>> # read Australia.geojson from dropbox, 15.5Mb
>>> test <- st_read("
>>> https://www.dropbox.com/s/060c6lfijyx1e5v/Australia.geojson?dl=1")
>>> st_is_valid(test)
>>>
>>> # The next lines work fine, I added them to illustrate what works
>>> ggplot(test) + geom_sf(aes(fill=STATE))
>>> ACT <- test[test$STATE == 'ACT', ]
>>> NSW <- test[test$STATE == 'NSW', ]
>>> ACTandNSW <- test[test$STATE %in% c('NSW','ACT'), ]
>>> noACT <- test[test$STATE != 'ACT', ]
>>> noNSW <- test[test$STATE != 'NSW', ]
>>> noACTandNSW <- test[!test$STATE %in% c('NSW','ACT'), ]
>>> # st_union works ok for most subsets. But note that some internal
>>> boundaries are not removed.
>>> ok <- st_union(ACT)
>>> # donut polygons work fine
>>> ok <- st_union(NSW)
>>> # donut polygons (NSW) filled (ACT) work fine
>>> ok <- st_union(ACTandNSW)
>>> # all states except NSW work fine
>>> ok <- st_union(noNSW)
>>> # ok if both ACT and NSW are removed
>>> ok <- st_union(noACTandNSW)
>>> ggplot(ok) + geom_sf()
>>>
>>> # Thing go pear-shaped if the hole is filled (ACT in NSW), but only if
>>> neighbours of the filled donut polygon are present.
>>> # The two lines below stall R and eventually crash RStudio
>>> crash <- st_union(test)
>>> # Australia without its governing territory kills R
>>> crash <- st_union(noACT)
>>>
>>>
>>>> sessionInfo()
>>> R version 3.5.1 (2018-07-02)
>>> Platform: x86_64-w64-mingw32/x64 (64-bit)
>>> Running under: Windows >= 8 x64 (build 9200)
>>>
>>> Matrix products: default
>>>
>>> locale:
>>>   [1] LC_COLLATE=English_Australia.1252  LC_CTYPE=English_Australia.1252
>>>   LC_MONETARY=English_Australia.1252
>>> [4] LC_NUMERIC=C                       LC_TIME=English_Australia.1252
>>>
>>> attached base packages:
>>>   [1] stats     graphics  grDevices utils     datasets  methods   base
>>>
>>> other attached packages:
>>>   [1] ggplot2_3.0.0 sf_0.6-3
>>>
>>> loaded via a namespace (and not attached):
>>>   [1] Rcpp_0.12.18     rstudioapi_0.7   bindr_0.1.1      magrittr_1.5
>>>  units_0.6-0      tidyselect_0.2.4 munsell_0.5.0
>>> [8] colorspace_1.3-2 R6_2.2.2         rlang_0.2.2      plyr_1.8.4
>>>  dplyr_0.7.6      tools_3.5.1      grid_3.5.1
>>> [15] gtable_0.2.0     e1071_1.7-0      DBI_1.0.0        withr_2.1.2
>>> class_7.3-14     digest_0.6.16    yaml_2.2.0
>>> [22] lazyeval_0.2.1   assertthat_0.2.0 tibble_1.4.2     crayon_1.3.4
>>>  bindrcpp_0.2.2   spData_0.2.9.3   purrr_0.2.5
>>> [29] glue_1.3.0       compiler_3.5.1   pillar_1.3.0     scales_1.0.0
>>>  classInt_0.2-3   pkgconfig_2.0.2
>>>
>>>
>>>
>>>
>>>
>>>         [[alternative HTML version deleted]]
>>>
>>> _______________________________________________
>>> R-sig-Geo mailing list
>>> [hidden email]
>>> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>>>
>>
>>
>>
>
> --
> Roger Bivand
> Department of Economics, Norwegian School of Economics,
> Helleveien 30, N-5045 Bergen, Norway.
> voice: +47 55 95 93 55; e-mail: [hidden email]
> http://orcid.org/0000-0003-2392-6140
> https://scholar.google.no/citations?user=AWeghB0AAAAJ&hl=en
>
> [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-Geo mailing list
> [hidden email]
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo--
Roger Bivand
Department of Economics, Norwegian School of Economics,
Helleveien 30, N-5045 Bergen, Norway.
voice: +47 55 95 93 55; e-mail: [hidden email]
http://orcid.org/0000-0003-2392-6140
https://scholar.google.no/citations?user=AWeghB0AAAAJ&hl=en
_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo
Roger Bivand
Department of Economics
Norwegian School of Economics
Helleveien 30
N-5045 Bergen, Norway

Re: st_union crashes RStudio - bug?

Fri, 09/14/2018 - 14:19
(from an airport)

> crash <- st_union(noACT)

completed without error, test also passes. Your problem is not general

There is absolutely no need to use ggplot to display the geometries, by the way.

plot(st_geometry(crash))

shows errant partial boundaries, probably caused by the default precision model and geojson's character representation of numbers.

Roger

Roger Bivand
Norwegian School of Economics
Bergen, Norway




On Fri, Sep 14, 2018 at 7:00 PM +0200, "Roger Bivand" <[hidden email]<mailto:[hidden email]>> wrote:


On Fri, 14 Sep 2018, Roman Luštrik wrote:

> Crashes R or Rstudio?

I guess the OP will get up sometime soon; of course one should always run
R in a console, not RStudio when reporting issues of this kind. Further,
one should run R -d gdb (if possible - see RW FAQ) to trap any important
information. I can see that crash <- st_union(noACT) is long-running, with
one thread at 100%, but no obvious memory issues (Fedora 28, sf 0.6-3,
GEOS 3.7.0). It would further make sense to go the sp/rgeos route to see
if it is data+GEOS or that the behavious is R-implementation dependent.

Roger

>
> Cheers,
> Roman
>
> On Fri, Sep 14, 2018 at 8:33 AM Bertram Ostendorf <
> [hidden email]> wrote:
>
>> I am trying to dissolve internal boundaries using sf.  This crashes R in
>> the example geojson map below, a simple map of Australia’s states and
>> territories. I am using a polygon layer that processes fine in other GIS
>> and also works fine using sp (casting to sp and using gUnaryUnion).  I am
>> not after a workaround but I'd like to explore what's different in sf and
>> why this particular layer causes problems.
>>
>> My questions: Is this a bug in sf? Have others experienced similar issues
>> using simple features?
>>
>> Thanks
>>
>> Bertram Ostendorf
>> Chair for Spatial Environmental Sciences
>> Director: Spatial Information Group
>> The University of Adelaide, AUSTRALIA 5005
>>
>>
>> # Here's my example layer and code:
>> # Note: Neither ArcGIS ‘repair geometry’ nor  ‘st_is_valid’ show any
>> issues.
>> library(sf)
>> library(ggplot2)
>> # read Australia.geojson from dropbox, 15.5Mb
>> test <- st_read("
>> https://www.dropbox.com/s/060c6lfijyx1e5v/Australia.geojson?dl=1")
>> st_is_valid(test)
>>
>> # The next lines work fine, I added them to illustrate what works
>> ggplot(test) + geom_sf(aes(fill=STATE))
>> ACT <- test[test$STATE == 'ACT', ]
>> NSW <- test[test$STATE == 'NSW', ]
>> ACTandNSW <- test[test$STATE %in% c('NSW','ACT'), ]
>> noACT <- test[test$STATE != 'ACT', ]
>> noNSW <- test[test$STATE != 'NSW', ]
>> noACTandNSW <- test[!test$STATE %in% c('NSW','ACT'), ]
>> # st_union works ok for most subsets. But note that some internal
>> boundaries are not removed.
>> ok <- st_union(ACT)
>> # donut polygons work fine
>> ok <- st_union(NSW)
>> # donut polygons (NSW) filled (ACT) work fine
>> ok <- st_union(ACTandNSW)
>> # all states except NSW work fine
>> ok <- st_union(noNSW)
>> # ok if both ACT and NSW are removed
>> ok <- st_union(noACTandNSW)
>> ggplot(ok) + geom_sf()
>>
>> # Thing go pear-shaped if the hole is filled (ACT in NSW), but only if
>> neighbours of the filled donut polygon are present.
>> # The two lines below stall R and eventually crash RStudio
>> crash <- st_union(test)
>> # Australia without its governing territory kills R
>> crash <- st_union(noACT)
>>
>>
>>> sessionInfo()
>> R version 3.5.1 (2018-07-02)
>> Platform: x86_64-w64-mingw32/x64 (64-bit)
>> Running under: Windows >= 8 x64 (build 9200)
>>
>> Matrix products: default
>>
>> locale:
>>   [1] LC_COLLATE=English_Australia.1252  LC_CTYPE=English_Australia.1252
>>   LC_MONETARY=English_Australia.1252
>> [4] LC_NUMERIC=C                       LC_TIME=English_Australia.1252
>>
>> attached base packages:
>>   [1] stats     graphics  grDevices utils     datasets  methods   base
>>
>> other attached packages:
>>   [1] ggplot2_3.0.0 sf_0.6-3
>>
>> loaded via a namespace (and not attached):
>>   [1] Rcpp_0.12.18     rstudioapi_0.7   bindr_0.1.1      magrittr_1.5
>>  units_0.6-0      tidyselect_0.2.4 munsell_0.5.0
>> [8] colorspace_1.3-2 R6_2.2.2         rlang_0.2.2      plyr_1.8.4
>>  dplyr_0.7.6      tools_3.5.1      grid_3.5.1
>> [15] gtable_0.2.0     e1071_1.7-0      DBI_1.0.0        withr_2.1.2
>> class_7.3-14     digest_0.6.16    yaml_2.2.0
>> [22] lazyeval_0.2.1   assertthat_0.2.0 tibble_1.4.2     crayon_1.3.4
>>  bindrcpp_0.2.2   spData_0.2.9.3   purrr_0.2.5
>> [29] glue_1.3.0       compiler_3.5.1   pillar_1.3.0     scales_1.0.0
>>  classInt_0.2-3   pkgconfig_2.0.2
>>
>>
>>
>>
>>
>>         [[alternative HTML version deleted]]
>>
>> _______________________________________________
>> R-sig-Geo mailing list
>> [hidden email]
>> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>>
>
>
>
--
Roger Bivand
Department of Economics, Norwegian School of Economics,
Helleveien 30, N-5045 Bergen, Norway.
voice: +47 55 95 93 55; e-mail: [hidden email]
http://orcid.org/0000-0003-2392-6140
https://scholar.google.no/citations?user=AWeghB0AAAAJ&hl=en

        [[alternative HTML version deleted]]

_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo
Roger Bivand
Department of Economics
Norwegian School of Economics
Helleveien 30
N-5045 Bergen, Norway

Re: Subsetting dataframe by all factor levels

Fri, 09/14/2018 - 13:17
On Fri, 14 Sep 2018, Justin H. wrote:

> One more thing. Let's still assume you want to interpolate it yearly. The
> below code will assign names to the output during the loop.
>
> for (i in levels(rainfall.year[,#year])) {
> assign ( paste (i,"interpolation output",sep = "_")
> , interpolation_function()
> }

Justin,

   Thanks again.

Regards,

Rich

_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

Re: Subsetting dataframe by all factor levels

Fri, 09/14/2018 - 13:10
One more thing. Let's still assume you want to interpolate it yearly. The
below code will assign names to the output during the loop.

for (i in levels(rainfall.year[,#year])) {
assign ( paste (i,"interpolation output",sep = "_")
, interpolation_function()
}


Cheers,
Justin

On Fri, Sep 14, 2018 at 2:03 PM Justin H. <[hidden email]> wrote:

> Hi Rich,
>
> For the sake of example, here's a solution for a simple aggregation.
>
> >aggregate(rainfall, list(rainfall$name), mean)  #This will aggregate all
> columns and determine their mean. You're left with 58 rows.
> >aggregate( rainfall[, #:#], list(rainfall$name), mean)  #In case you only
> want to aggregate over select columns.
>
>
> I am assuming you want rows with every combination of year and station
> with their average precipitations. To aggregate it in that way you will
> need to create a new column that represents the year (or month/year if the
> data are appropriate for that resolution).
>
> >rainfall.year<-with(rainfall, tapply(prcp, list(name, year), mean))
> #This does the aggregation.
> >rainfall.year<-data.frame(as.table(rainfall.year))  #However, you are
> given a "wide" data frame. This makes it "long" as you probably want it.
>
> A for-do-done loop option.
>
> for (i in levels(rainfall.year[,#year])) {
> print(i)
> print(mean(rainfall.year[rainfall.year$year==i,#prcp]))
> }
>
> The loop will return the mean rainfall per year, where #year is the number
> for the year column and #prcp is for precipitation.
> Try running that loop to see that it is properly looping through the
> factor you want and then stick in the interpolation function.
>
> I hope that helps!
>
> Cheers,
> Justin
>
> On Fri, Sep 14, 2018 at 1:13 PM Rich Shepard <[hidden email]>
> wrote:
>
>>    I need to learn geospatial analyses in R to complement my GIS
>> knowledge.
>> I've just re-read the subsetting chapter in Hadley's 'Advanced R' without
>> seeing how to create separate data frames based by extracting all rows for
>> each site name in the parent data frame in one step. I believe that what I
>> need to do is create a list of the factor names and feed them to a loop
>> subsetting each to a new dataframe. Perhaps there's a better way unknown
>> to
>> me and I need advice, suggestions, and recommendations how to proceed.
>>
>>    The inclusive data frame has this structure:
>>
>> str(rainfall)
>> 'data.frame':   113569 obs. of  6 variables:
>>   $ name    : Factor w/ 58 levels "Blazed Alder",..: 20 20 20 20 20 20 20
>> ...
>>   $ easting : num  2370575 2370575 2370575 2370575 2370575 ...
>>   $ northing: num  199338 199338 199338 199338 199338 ...
>>   $ elev    : num  228 228 228 228 228 228 228 228 228 228 ...
>>   $ sampdate: Date, format: "2005-01-01" "2005-01-02" ...
>>   $ prcp    : num  0.59 0.08 0.1 0 0 0.02 0.05 0.1 0 0.02 ...
>>
>>    My goal is to use the monthly mean rainfall at each of the 58 reporting
>> stations to interpolate/extrapolate rainfall over the entire county for
>> selected years to show variability. The data points are not evenly
>> distributed but clustered in more populated areas and dispersed in rural
>> areas. My geochemical data typically are like this and I need to also
>> learn
>> how this distribution affects how the data are analyzed.
>>
>> TIA,
>>
>> Rich
>>
>> _______________________________________________
>> R-sig-Geo mailing list
>> [hidden email]
>> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>>
>
        [[alternative HTML version deleted]]

_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

Re: Subsetting dataframe by all factor levels

Fri, 09/14/2018 - 13:05
On Fri, 14 Sep 2018, Phil Radtke wrote:

> would something as simple as this do what you need?
> rainfall_by_site <- split(rainfall,rainfall$name)

Phil,

   Yes, it certainly would do the job.

> I found this on stackoverflow by the web search: R create separate data
> frame based on factor
> https://stackoverflow.com/questions/9713294/split-data-frame-based-on-levels-of-a-factor-into-new-data-frames

   Either I missed this hit when I tried the same search string or duckduckgo
missed it.

   Thanks very much.

Regards,

Rich

_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

Re: Subsetting dataframe by all factor levels

Fri, 09/14/2018 - 13:03
Hi Rich,

For the sake of example, here's a solution for a simple aggregation.

>aggregate(rainfall, list(rainfall$name), mean)  #This will aggregate all
columns and determine their mean. You're left with 58 rows.
>aggregate( rainfall[, #:#], list(rainfall$name), mean)  #In case you only
want to aggregate over select columns.


I am assuming you want rows with every combination of year and station with
their average precipitations. To aggregate it in that way you will need to
create a new column that represents the year (or month/year if the data are
appropriate for that resolution).

>rainfall.year<-with(rainfall, tapply(prcp, list(name, year), mean))  #This
does the aggregation.
>rainfall.year<-data.frame(as.table(rainfall.year))  #However, you are
given a "wide" data frame. This makes it "long" as you probably want it.

A for-do-done loop option.

for (i in levels(rainfall.year[,#year])) {
print(i)
print(mean(rainfall.year[rainfall.year$year==i,#prcp]))
}

The loop will return the mean rainfall per year, where #year is the number
for the year column and #prcp is for precipitation.
Try running that loop to see that it is properly looping through the factor
you want and then stick in the interpolation function.

I hope that helps!

Cheers,
Justin

On Fri, Sep 14, 2018 at 1:13 PM Rich Shepard <[hidden email]>
wrote:

>    I need to learn geospatial analyses in R to complement my GIS knowledge.
> I've just re-read the subsetting chapter in Hadley's 'Advanced R' without
> seeing how to create separate data frames based by extracting all rows for
> each site name in the parent data frame in one step. I believe that what I
> need to do is create a list of the factor names and feed them to a loop
> subsetting each to a new dataframe. Perhaps there's a better way unknown to
> me and I need advice, suggestions, and recommendations how to proceed.
>
>    The inclusive data frame has this structure:
>
> str(rainfall)
> 'data.frame':   113569 obs. of  6 variables:
>   $ name    : Factor w/ 58 levels "Blazed Alder",..: 20 20 20 20 20 20 20
> ...
>   $ easting : num  2370575 2370575 2370575 2370575 2370575 ...
>   $ northing: num  199338 199338 199338 199338 199338 ...
>   $ elev    : num  228 228 228 228 228 228 228 228 228 228 ...
>   $ sampdate: Date, format: "2005-01-01" "2005-01-02" ...
>   $ prcp    : num  0.59 0.08 0.1 0 0 0.02 0.05 0.1 0 0.02 ...
>
>    My goal is to use the monthly mean rainfall at each of the 58 reporting
> stations to interpolate/extrapolate rainfall over the entire county for
> selected years to show variability. The data points are not evenly
> distributed but clustered in more populated areas and dispersed in rural
> areas. My geochemical data typically are like this and I need to also learn
> how this distribution affects how the data are analyzed.
>
> TIA,
>
> Rich
>
> _______________________________________________
> R-sig-Geo mailing list
> [hidden email]
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>
        [[alternative HTML version deleted]]

_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

Subsetting dataframe by all factor levels

Fri, 09/14/2018 - 12:12
   I need to learn geospatial analyses in R to complement my GIS knowledge.
I've just re-read the subsetting chapter in Hadley's 'Advanced R' without
seeing how to create separate data frames based by extracting all rows for
each site name in the parent data frame in one step. I believe that what I
need to do is create a list of the factor names and feed them to a loop
subsetting each to a new dataframe. Perhaps there's a better way unknown to
me and I need advice, suggestions, and recommendations how to proceed.

   The inclusive data frame has this structure:

str(rainfall)
'data.frame': 113569 obs. of  6 variables:
  $ name    : Factor w/ 58 levels "Blazed Alder",..: 20 20 20 20 20 20 20 ...
  $ easting : num  2370575 2370575 2370575 2370575 2370575 ...
  $ northing: num  199338 199338 199338 199338 199338 ...
  $ elev    : num  228 228 228 228 228 228 228 228 228 228 ...
  $ sampdate: Date, format: "2005-01-01" "2005-01-02" ...
  $ prcp    : num  0.59 0.08 0.1 0 0 0.02 0.05 0.1 0 0.02 ...

   My goal is to use the monthly mean rainfall at each of the 58 reporting
stations to interpolate/extrapolate rainfall over the entire county for
selected years to show variability. The data points are not evenly
distributed but clustered in more populated areas and dispersed in rural
areas. My geochemical data typically are like this and I need to also learn
how this distribution affects how the data are analyzed.

TIA,

Rich

_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

Re: st_union crashes RStudio - bug?

Fri, 09/14/2018 - 11:59
On Fri, 14 Sep 2018, Roman Luštrik wrote:

> Crashes R or Rstudio?

I guess the OP will get up sometime soon; of course one should always run
R in a console, not RStudio when reporting issues of this kind. Further,
one should run R -d gdb (if possible - see RW FAQ) to trap any important
information. I can see that crash <- st_union(noACT) is long-running, with
one thread at 100%, but no obvious memory issues (Fedora 28, sf 0.6-3,
GEOS 3.7.0). It would further make sense to go the sp/rgeos route to see
if it is data+GEOS or that the behavious is R-implementation dependent.

Roger

>
> Cheers,
> Roman
>
> On Fri, Sep 14, 2018 at 8:33 AM Bertram Ostendorf <
> [hidden email]> wrote:
>
>> I am trying to dissolve internal boundaries using sf.  This crashes R in
>> the example geojson map below, a simple map of Australia’s states and
>> territories. I am using a polygon layer that processes fine in other GIS
>> and also works fine using sp (casting to sp and using gUnaryUnion).  I am
>> not after a workaround but I'd like to explore what's different in sf and
>> why this particular layer causes problems.
>>
>> My questions: Is this a bug in sf? Have others experienced similar issues
>> using simple features?
>>
>> Thanks
>>
>> Bertram Ostendorf
>> Chair for Spatial Environmental Sciences
>> Director: Spatial Information Group
>> The University of Adelaide, AUSTRALIA 5005
>>
>>
>> # Here's my example layer and code:
>> # Note: Neither ArcGIS ‘repair geometry’ nor  ‘st_is_valid’ show any
>> issues.
>> library(sf)
>> library(ggplot2)
>> # read Australia.geojson from dropbox, 15.5Mb
>> test <- st_read("
>> https://www.dropbox.com/s/060c6lfijyx1e5v/Australia.geojson?dl=1")
>> st_is_valid(test)
>>
>> # The next lines work fine, I added them to illustrate what works
>> ggplot(test) + geom_sf(aes(fill=STATE))
>> ACT <- test[test$STATE == 'ACT', ]
>> NSW <- test[test$STATE == 'NSW', ]
>> ACTandNSW <- test[test$STATE %in% c('NSW','ACT'), ]
>> noACT <- test[test$STATE != 'ACT', ]
>> noNSW <- test[test$STATE != 'NSW', ]
>> noACTandNSW <- test[!test$STATE %in% c('NSW','ACT'), ]
>> # st_union works ok for most subsets. But note that some internal
>> boundaries are not removed.
>> ok <- st_union(ACT)
>> # donut polygons work fine
>> ok <- st_union(NSW)
>> # donut polygons (NSW) filled (ACT) work fine
>> ok <- st_union(ACTandNSW)
>> # all states except NSW work fine
>> ok <- st_union(noNSW)
>> # ok if both ACT and NSW are removed
>> ok <- st_union(noACTandNSW)
>> ggplot(ok) + geom_sf()
>>
>> # Thing go pear-shaped if the hole is filled (ACT in NSW), but only if
>> neighbours of the filled donut polygon are present.
>> # The two lines below stall R and eventually crash RStudio
>> crash <- st_union(test)
>> # Australia without its governing territory kills R
>> crash <- st_union(noACT)
>>
>>
>>> sessionInfo()
>> R version 3.5.1 (2018-07-02)
>> Platform: x86_64-w64-mingw32/x64 (64-bit)
>> Running under: Windows >= 8 x64 (build 9200)
>>
>> Matrix products: default
>>
>> locale:
>>   [1] LC_COLLATE=English_Australia.1252  LC_CTYPE=English_Australia.1252
>>   LC_MONETARY=English_Australia.1252
>> [4] LC_NUMERIC=C                       LC_TIME=English_Australia.1252
>>
>> attached base packages:
>>   [1] stats     graphics  grDevices utils     datasets  methods   base
>>
>> other attached packages:
>>   [1] ggplot2_3.0.0 sf_0.6-3
>>
>> loaded via a namespace (and not attached):
>>   [1] Rcpp_0.12.18     rstudioapi_0.7   bindr_0.1.1      magrittr_1.5
>>  units_0.6-0      tidyselect_0.2.4 munsell_0.5.0
>> [8] colorspace_1.3-2 R6_2.2.2         rlang_0.2.2      plyr_1.8.4
>>  dplyr_0.7.6      tools_3.5.1      grid_3.5.1
>> [15] gtable_0.2.0     e1071_1.7-0      DBI_1.0.0        withr_2.1.2
>> class_7.3-14     digest_0.6.16    yaml_2.2.0
>> [22] lazyeval_0.2.1   assertthat_0.2.0 tibble_1.4.2     crayon_1.3.4
>>  bindrcpp_0.2.2   spData_0.2.9.3   purrr_0.2.5
>> [29] glue_1.3.0       compiler_3.5.1   pillar_1.3.0     scales_1.0.0
>>  classInt_0.2-3   pkgconfig_2.0.2
>>
>>
>>
>>
>>
>>         [[alternative HTML version deleted]]
>>
>> _______________________________________________
>> R-sig-Geo mailing list
>> [hidden email]
>> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>>
>
>
> --
Roger Bivand
Department of Economics, Norwegian School of Economics,
Helleveien 30, N-5045 Bergen, Norway.
voice: +47 55 95 93 55; e-mail: [hidden email]
http://orcid.org/0000-0003-2392-6140
https://scholar.google.no/citations?user=AWeghB0AAAAJ&hl=en
_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo
Roger Bivand
Department of Economics
Norwegian School of Economics
Helleveien 30
N-5045 Bergen, Norway

Re: Help with simple Map of US states to predefined regions

Fri, 09/14/2018 - 02:59
Thank you Jerome, I will peruse and let you know.

Best regards
WHP


From: Jérome Mathieu <[hidden email]>
Sent: Friday, September 14, 2018 3:37 AM
To: Bill Poling <[hidden email]>
Cc: r-sig-geo <[hidden email]>
Subject: Re: [R-sig-Geo] Help with simple Map of US states to predefined regions

Hi,

this might help you:

http://socviz.co/maps.html#maps<http://socviz.co/maps.html#maps>
http://strimas.com/r/tidy-sf/<http://strimas.com/r/tidy-sf/>
https://cran.r-project.org/web/packages/fiftystater/vignettes/fiftystater.html<https://cran.r-project.org/web/packages/fiftystater/vignettes/fiftystater.html>

Jerome





Le mer. 12 sept. 2018 à 20:27, Bill Poling <[hidden email]<mailto:[hidden email]>> a écrit :
>
> Hi
>
> I have this df with three columns ProviderState, ProviderStateCode, ProviderRegion I wanted to use to create a simple 5 color map
>
> I have reviewed fiftystater pkg and map pkg but not sure how to simply take these three columns and plot a simple 5 color map based on the Region the state is in?
>
> After looking at these and trying to apply these ideas to my data
> https://cran.r-project.org/web/packages/fiftystater/vignettes/fiftystater.html<https://cran.r-project.org/web/packages/fiftystater/vignettes/fiftystater.html>
> https://cran.r-project.org/web/packages/maps/maps.pdf<https://cran.r-project.org/web/packages/maps/maps.pdf>
>
> I found tutorial at: https://uchicagoconsulting.wordpress.com/tag/r-ggplot2-maps-visualization/<https://uchicagoconsulting.wordpress.com/tag/r-ggplot2-maps-visualization/>
>
> I used the tutorial data and subset in my regions
>
> So now I have come up with the 5 segmented maps and my question becomes how to put this all into one map of the US?
>
>
> install.packages("maps")
> library(maps)
> library(ggplot2)
>
> #load us map data
> all_states <- map_data("state") View(all_states)
> #plot all states with ggplot
> p <- ggplot()
> p <- p + geom_polygon( data=all_states, aes(x=long, y=lat, group = group),colour="white", fill="blue" )
> p
>
> #http://sape.inf.usi.ch/quick-reference/ggplot2/colour<http://sape.inf.usi.ch/quick-reference/ggplot2/colour>
>
> #Pacificstates
> Pacificstates <- subset(all_states, region %in% c( "alaska", "arizona", "california", "hawaii", "nevada", "oregon","washington") )
> p <- ggplot()
> p <- p + geom_polygon( data=Pacificstates, aes(x=long, y=lat, group = group),colour="white", fill="deepskyblue4" ) +
>   labs(title = "Pacificstates")
> p
>
> #Frontierstates
> Frontierstates <- subset(all_states, region %in% c( "colorado", "idaho", "kansas", "montana", "new mexico", "oklahoma","texas", "utah", "wyoming") )
> p <- ggplot()
> p <- p + geom_polygon( data=Frontierstates, aes(x=long, y=lat, group = group),colour="white", fill="dodgerblue1" ) +
>       labs(title = "FrontierStates")
> p
>
> #Midweststates
> Midweststates <- subset(all_states, region %in% c( "iowa", "illinois", "indiana", "michigan", "minnesota", "missouri","north dakota", "nebraska", "ohio","south dakota","wisconsin") )
> p <- ggplot()
> p <- p + geom_polygon( data=Midweststates, aes(x=long, y=lat, group = group),colour="white", fill="dodgerblue1" ) +
>       labs(title = "MidwestStates")
> p
>
> #Southernstates
> Southernstates <- subset(all_states, region %in% c( "alabama", "arkansas", "florida", "georgia", "kentucky", "louisiana","mississippi"
>                                                     ,"north carolina", "south carolina","tennessee","virginia","west virginia") )
> p <- ggplot()
> p <- p + geom_polygon( data=Southernstates, aes(x=long, y=lat, group = group),colour="white", fill="royalblue2" ) +
>   labs(title = "Southernstates")
> p
>
> # Northeaststates
> Northeaststates <- subset(all_states, region %in% c( "connecticut", "district of columbia", "delaware", "massachusetts", "maryland", "maine","new hampshire"
>                                                      , "new jersey", "new york","pennsylvania","rhode island","vermont") )
> p <- ggplot()
> p <- p + geom_polygon( data=Northeaststates, aes(x=long, y=lat, group = group),colour="white", fill="dodgerblue4" ) +
>   labs(title = "Northeaststates")
> p
>
>
> #here is my my data but not used above
>
> str(Map1)
> Classes 'tbl_df', 'tbl' and 'data.frame':    54 obs. of  3 variables:
> $ ProviderState    : chr  "ALASKA" "ALABAMA" "ARKANSAS" "ARIZONA" ...
> $ ProviderStateCode: chr  "AK" "AL" "AR" "AZ" ...
> $ ProviderRegion   : chr  "Pacific" "South" "South" "Pacific" ...
> - attr(*, "spec")=List of 2
>   ..$ cols   :List of 3
>   .. ..$ ProviderState    : list()
>   .. .. ..- attr(*, "class")= chr  "collector_character" "collector"
>   .. ..$ ProviderStateCode: list()
>   .. .. ..- attr(*, "class")= chr  "collector_character" "collector"
>   .. ..$ ProviderRegion   : list()
>   .. .. ..- attr(*, "class")= chr  "collector_character" "collector"
>   ..$ default: list()
>   .. ..- attr(*, "class")= chr  "collector_guess" "collector"
>   ..- attr(*, "class")= chr "col_spec"
>
> dput(Map1)
> structure(list(ProviderState = c("ALASKA", "ALABAMA", "ARKANSAS",
> "ARIZONA", "CALIFORNIA", "COLORADO", "CONNECTICUT", "DISTRICT OF COLUMBIA",
> "DELAWARE", "FLORIDA", "GEORGIA", "GUAM", "HAWAII", "IOWA", "IDAHO",
> "ILLINOIS", "INDIANA", "KANSAS", "KENTUCKY", "LOUISIANA", "MASSACHUSETTS",
> "MARYLAND", "MAINE", "MICHIGAN", "MINNESOTA", "MISSOURI", "MISSISSIPPI",
> "MONTANA", "NORTH CAROLINA", "NORTH DAKOTA", "NEBRASKA", "NEW HAMPSHIRE",
> "NEW JERSEY", "NEW MEXICO", "NEVADA", "NEW YORK", "OHIO", "OKLAHOMA",
> "OREGON", "PENNSYLVANIA", "PUERTO RICO", "RHODE ISLAND", "SOUTH CAROLINA",
> "SOUTH DAKOTA", "TENNESSEE", "TEXAS", "UTAH", "VIRGINIA", "VIRGIN ISLANDS",
> "VERMONT", "WASHINGTON", "WISCONSIN", "WEST VIRGINIA", "WYOMING"
> ), ProviderStateCode = c("AK", "AL", "AR", "AZ", "CA", "CO",
> "CT", "DC", "DE", "FL", "GA", "GU", "HI", "IA", "ID", "IL", "IN",
> "KS", "KY", "LA", "MA", "MD", "ME", "MI", "MN", "MO", "MS", "MT",
> "NC", "ND", "NE", "NH", "NJ", "NM", "NV", "NY", "OH", "OK", "OR",
> "PA", "PR", "RI", "SC", "SD", "TN", "TX", "UT", "VA", "VI", "VT",
> "WA", "WI", "WV", "WY"), ProviderRegion = c("Pacific", "South",
> "South", "Pacific", "Pacific", "Frontier", "Northeast", "Northeast",
> "Northeast", "South", "South", "Pacific", "Pacific", "Midwest",
> "Frontier", "Midwest", "Midwest", "Frontier", "South", "South",
> "Northeast", "Northeast", "Northeast", "Midwest", "Midwest",
> "Midwest", "South", "Frontier", "South", "Midwest", "Midwest",
> "Northeast", "Northeast", "Frontier", "Pacific", "Northeast",
> "Midwest", "Frontier", "Pacific", "Northeast", "Northeast", "Northeast",
> "South", "Midwest", "South", "Frontier", "Frontier", "South",
> "Northeast", "Northeast", "Pacific", "Midwest", "South", "Frontier"
> )), row.names = c(NA, -54L), class = c("tbl_df", "tbl", "data.frame"
> ), spec = structure(list(cols = list(ProviderState = structure(list(), class = c("collector_character",
> "collector")), ProviderStateCode = structure(list(), class = c("collector_character",
> "collector")), ProviderRegion = structure(list(), class = c("collector_character",
> "collector"))), default = structure(list(), class = c("collector_guess",
> "collector"))), class = "col_spec"))
>
> Thank you for any suggestions.
>
> WHP
>
>
>
>
>
>
> Confidentiality Notice This message is sent from Zelis. ...{{dropped:15}}
>
> _______________________________________________
> R-sig-Geo mailing list
> [hidden email]<mailto:[hidden email]>
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo<https://stat.ethz.ch/mailman/listinfo/r-sig-geo>


Confidentiality Notice This message is sent from Zelis. This transmission may contain information which is privileged and confidential and is intended for the personal and confidential use of the named recipient only. Such information may be protected by applicable State and Federal laws from this disclosure or unauthorized use. If the reader of this message is not the intended recipient, or the employee or agent responsible for delivering the message to the intended recipient, you are hereby notified that any disclosure, review, discussion, copying, or taking any action in reliance on the contents of this transmission is strictly prohibited. If you have received this transmission in error, please contact the sender immediately. Zelis, 2018.

        [[alternative HTML version deleted]]

_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

Help with simple Map of US states with predefined regions Version 2 (Solved)

Fri, 09/14/2018 - 02:57
Good morning Don, I cannot thank you enough for your support and the trouble you went to.
I am novice useR and the only analyst in the shop asked to learn R and the demands are growing faster than my knowledge intake, lots of laughs!

Best regards

WHP

From: MacQueen, Don <[hidden email]>
Sent: Thursday, September 13, 2018 4:41 PM
To: Bill Poling <[hidden email]>; [hidden email]
Subject: Re: [R-sig-Geo] Help with simple Map of US states with predefined regions Version 2

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 Tiger file -- polygons of each US State
## try this URL for download
## https://www.census.gov/cgi-bin/geo/shapefiles/index.php?year=2017&layergroup=States+%28and+equivalent%29<https://www.census.gov/cgi-bin/geo/shapefiles/index.php?year=2017&layergroup=States+%28and+equivalent%29>

## unzip to working directory ( '.' )
ustf <- readOGR('.', 'tl_2017_us_state', stringsAsFactors=FALSE)

## note, the Tiger file includes 6 additional territories
dim(ustf)
## [1] 56 14

## get rid of the extra six territories (state.name<http://state.name> comes with R)
cus <- subset(ustf, NAME %in% state.name<http://state.name>)

## cheap rename
cus$state <- cus$NAME
cus$abb <- cus$STUSPS

## invent ridiculous groupings of states
cus$grp <- 'a'
cus$grp[11:20] <- 'b'
cus$grp[21:30] <- 'c'
cus$grp[31:40] <- 'd'
cus$grp[41:50] <- 'e'

## assign colors to the groups
cus$color <- 'red'
cus$color[cus$grp=='b'] <- 'green'
cus$color[cus$grp=='c'] <- 'blue'
cus$color[cus$grp=='d'] <- 'brown'
cus$color[cus$grp=='e'] <- 'cyan'

## exclude Alaska, Hawaii
cus <- subset(cus, !(state %in% c('Alaska','Hawaii')))

## get rid of extraneous variables (optional)
cus <- cus[ , c('state','REGION','abb', 'grp') ]

## plot colored by regions as defined in the Census Bureau Tiger file
plot(cus, col=cus$REGION, usePolypath=FALSE)

## color "1" is black, looks bad, do this instead
plot(cus, col=as.numeric(cus$REGION)+1, usePolypath=FALSE)
text(coordinates(cus), cus$abb, col='white', cex=0.75)

## colors specified by a color variable in the data
plot(cus, col=cus$color, usePolypath=FALSE)
text(coordinates(cus), cus$abb, col='white', cex=0.75)

(my preferred graphics device does not support Polypath, but probably most others do, so one can omit usePolypath=FALSE)

-Don

--
Don MacQueen
Lawrence Livermore National Laboratory
7000 East Ave., L-627
Livermore, CA 94550
925-423-1062
Lab cell 925-724-7509



On 9/13/18, 5:17 AM, "R-sig-Geo on behalf of Bill Poling" <[hidden email] on behalf of [hidden email]<mailto:[hidden email]%20on%20behalf%20of%[hidden email]>> wrote:

Hi,

I hope someone can help me finalize this please.

I am coming close to what I need using variations from two ggplot2 tutorials.

This first gives me the map of the US with AK & HI but I cannot figure out how to get my 5 regions colored

#https://stackoverflow.com/questions/38021188/how-to-draw-u-s-state-map-with-hi-and-ak-with-state-abbreviations-centered-us?rq=1<https://stackoverflow.com/questions/38021188/how-to-draw-u-s-state-map-with-hi-and-ak-with-state-abbreviations-centered-us?rq=1>


library(ggplot2)
install.packages("ggalt")
library(ggalt) # coord_proj
library(albersusa) # devtools::install_github("hrbrmstr/albersusa")
install.packages("ggthemes")
library(ggthemes) # theme_map
install.packages("rgeos")
library(rgeos) # centroids
library(dplyr)

# composite map with AK & HI
usa_map <- usa_composite()

# calculate the centroids for each state gCentroid(usa_map, byid=TRUE) %>%
as.data.frame() %>%
mutate(state=usa_map@data$iso_3166_2) -> centroids

# make it usable in ggplot2
usa_map <- fortify(usa_map)

View(usa_map)
t1 <- head(usa_map,n=5)
knitr::kable(t1, row.names=FALSE, align=c("l", "l", "r", "r", "r"))

#

# |long |lat | group| order| region|subregion |
# |:---------|:--------|-----:|-----:|-------:|:---------|
# |-87.46201 |30.38968 | 1| 1| alabama|NA |
# |-87.48493 |30.37249 | 1| 2| alabama|NA |
# |-87.52503 |30.37249 | 1| 3| alabama|NA |
# |-87.53076 |30.33239 | 1| 4| alabama|NA |
# |-87.57087 |30.32665 | 1| 5| alabama|NA |

usa_map <- fortify(usa_map)
gg <- ggplot()
gg <- gg + geom_map(data=usa_map, map=usa_map,
aes(long, lat, map_id=id),
color="#2b2b2b", size=0.1, fill=NA)

gg <- gg + geom_text(data=centroids, aes(x, y, label=state), size=2) gg <- gg + coord_proj(us_laea_proj) gg <- gg + theme_map() gg




#************************************************************************************************************************************************************************************/

This second is an alternative (however not liking AK&HI, not coming into the map like scenario one above) but also ignoring new Mexico (because recognizing a seventh field value) and I suspect it will do the same for new York and new jersey etc.. when I add them to the list.

Error in scan(file = file, what = what, sep = sep, quote = quote, dec = dec, : line 12 did not have 6 elements

When I use newmexico (all one word) it appears white in the map like the other states not in the table statement

#https://stackoverflow.com/questions/38777732/r-code-to-generating-map-of-us-states-with-specific-colors<https://stackoverflow.com/questions/38777732/r-code-to-generating-map-of-us-states-with-specific-colors>

library(ggplot2)

read.table(text="State.Code region St_Abbr Num_Estab colors
1 1 alaska Ak 13123 #f7931e
3 1 arizona AZ 18053 #f7931e
5 1 california CA 143937 #f7931e
2 1 hawaii HI 123456 #f7931e
4 1 nevada NV 654321 #f7931e
6 1 oregon OR 321456 #f7931e
7 1 washington WA 456123 #f7931e
8 2 colorado CO 987654 #787878
9 2 idaho ID 13549 #787878
10 2 kansas KS 94531 #787878
11 2 montana MT 456321 #787878
12 2 new mexico NM 582310 #787878 <---Not liking new mexico, saying not 6
13 2 oklahoma OK 214567 #787878
14 2 texas TX 675421 #787878
15 2 utah UT 754321 #787878
16 2 wyoming WY 543124 #787878 ",
stringsAsFactors=FALSE, header=TRUE, comment.char="") -> df

usa_map1 <- map_data("state")
t1 <- head(usa_map1,n=5)
knitr::kable(t1, row.names=FALSE, align=c("l", "l", "r", "r", "r"))
View(usa_map1)
#
# |long |lat | group| order| region|subregion |
# |:---------|:--------|-----:|-----:|-------:|:---------|
# |-87.46201 |30.38968 | 1| 1| alabama|NA |
# |-87.48493 |30.37249 | 1| 2| alabama|NA |
# |-87.52503 |30.37249 | 1| 3| alabama|NA |
# |-87.53076 |30.33239 | 1| 4| alabama|NA |
# |-87.57087 |30.32665 | 1| 5| alabama|NA |



gg <- ggplot()
#View(gg)
gg <- gg + geom_map(data=usa_map1, map=usa_map1,
aes(long, lat, map_id=region),
color="#2b2b2b", size=0.15, fill=NA)

gg <- gg + geom_map(data=df, map=usa_map1,
aes(fill=colors, map_id=region),
color="#2b2b2b", size=0.15)


gg <- gg + geom_text(data=centroids, aes(x, y, label=state), size=2) gg <- gg + coord_proj(us_laea_proj) gg <- gg + theme_map() gg


gg <- gg + scale_color_identity()
gg <- gg + coord_map("polyconic")
gg <- gg + ggthemes::theme_map()
gg

#c( "colorado", "idaho", "kansas", "montana", "new mexico", "oklahoma","texas", "utah", "wyoming") ) #c("alaska", "arizona", "california", "hawaii", "nevada", "oregon","washington"))



William H. Poling, Ph.D., MPH




Confidentiality Notice This message is sent from Zelis. ...{{dropped:13}}

_______________________________________________
R-sig-Geo mailing list
[hidden email]<mailto:[hidden email]>
https://stat.ethz.ch/mailman/listinfo/r-sig-geo<https://stat.ethz.ch/mailman/listinfo/r-sig-geo>


Confidentiality Notice This message is sent from Zelis. This transmission may contain information which is privileged and confidential and is intended for the personal and confidential use of the named recipient only. Such information may be protected by applicable State and Federal laws from this disclosure or unauthorized use. If the reader of this message is not the intended recipient, or the employee or agent responsible for delivering the message to the intended recipient, you are hereby notified that any disclosure, review, discussion, copying, or taking any action in reliance on the contents of this transmission is strictly prohibited. If you have received this transmission in error, please contact the sender immediately. Zelis, 2018.

        [[alternative HTML version deleted]]

_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

Re: Help with simple Map of US states to predefined regions

Fri, 09/14/2018 - 02:36
Hi,

this might help you:

http://socviz.co/maps.html#maps
http://strimas.com/r/tidy-sf/
https://cran.r-project.org/web/packages/fiftystater/vignettes/fiftystater.html

Jerome





Le mer. 12 sept. 2018 à 20:27, Bill Poling <[hidden email]> a écrit :
>
> Hi
>
> I have this df with three columns ProviderState, ProviderStateCode,
ProviderRegion I wanted to use to create a simple 5 color map
>
> I have reviewed fiftystater pkg and map pkg but not sure how to simply
take these three columns and plot a simple 5 color map based on the Region
the state is in?
>
> After looking at these and trying to apply these ideas to my data
>
https://cran.r-project.org/web/packages/fiftystater/vignettes/fiftystater.html
> https://cran.r-project.org/web/packages/maps/maps.pdf
>
> I found tutorial at:
https://uchicagoconsulting.wordpress.com/tag/r-ggplot2-maps-visualization/
>
> I used the tutorial data and subset in my regions
>
> So now I have come up with the 5 segmented maps and my question becomes
how to put this all into one map of the US?
>
>
> install.packages("maps")
> library(maps)
> library(ggplot2)
>
> #load us map data
> all_states <- map_data("state") View(all_states)
> #plot all states with ggplot
> p <- ggplot()
> p <- p + geom_polygon( data=all_states, aes(x=long, y=lat, group = group),colour="white", fill="blue" )
> p
>
> #http://sape.inf.usi.ch/quick-reference/ggplot2/colour
>
> #Pacificstates
> Pacificstates <- subset(all_states, region %in% c( "alaska", "arizona",
"california", "hawaii", "nevada", "oregon","washington") )
> p <- ggplot()
> p <- p + geom_polygon( data=Pacificstates, aes(x=long, y=lat, group =
group),colour="white", fill="deepskyblue4" ) +
>   labs(title = "Pacificstates")
> p
>
> #Frontierstates
> Frontierstates <- subset(all_states, region %in% c( "colorado", "idaho",
"kansas", "montana", "new mexico", "oklahoma","texas", "utah", "wyoming") )
> p <- ggplot()
> p <- p + geom_polygon( data=Frontierstates, aes(x=long, y=lat, group =
group),colour="white", fill="dodgerblue1" ) +
>       labs(title = "FrontierStates")
> p
>
> #Midweststates
> Midweststates <- subset(all_states, region %in% c( "iowa", "illinois",
"indiana", "michigan", "minnesota", "missouri","north dakota", "nebraska",
"ohio","south dakota","wisconsin") )
> p <- ggplot()
> p <- p + geom_polygon( data=Midweststates, aes(x=long, y=lat, group =
group),colour="white", fill="dodgerblue1" ) +
>       labs(title = "MidwestStates")
> p
>
> #Southernstates
> Southernstates <- subset(all_states, region %in% c( "alabama",
"arkansas", "florida", "georgia", "kentucky", "louisiana","mississippi"
>                                                     ,"north carolina",
"south carolina","tennessee","virginia","west virginia") )
> p <- ggplot()
> p <- p + geom_polygon( data=Southernstates, aes(x=long, y=lat, group =
group),colour="white", fill="royalblue2" ) +
>   labs(title = "Southernstates")
> p
>
> # Northeaststates
> Northeaststates <- subset(all_states, region %in% c( "connecticut",
"district of columbia", "delaware", "massachusetts", "maryland",
"maine","new hampshire"
>                                                      , "new jersey", "new
york","pennsylvania","rhode island","vermont") )
> p <- ggplot()
> p <- p + geom_polygon( data=Northeaststates, aes(x=long, y=lat, group =
group),colour="white", fill="dodgerblue4" ) +
>   labs(title = "Northeaststates")
> p
>
>
> #here is my my data but not used above
>
> str(Map1)
> Classes 'tbl_df', 'tbl' and 'data.frame':    54 obs. of  3 variables:
> $ ProviderState    : chr  "ALASKA" "ALABAMA" "ARKANSAS" "ARIZONA" ...
> $ ProviderStateCode: chr  "AK" "AL" "AR" "AZ" ...
> $ ProviderRegion   : chr  "Pacific" "South" "South" "Pacific" ...
> - attr(*, "spec")=List of 2
>   ..$ cols   :List of 3
>   .. ..$ ProviderState    : list()
>   .. .. ..- attr(*, "class")= chr  "collector_character" "collector"
>   .. ..$ ProviderStateCode: list()
>   .. .. ..- attr(*, "class")= chr  "collector_character" "collector"
>   .. ..$ ProviderRegion   : list()
>   .. .. ..- attr(*, "class")= chr  "collector_character" "collector"
>   ..$ default: list()
>   .. ..- attr(*, "class")= chr  "collector_guess" "collector"
>   ..- attr(*, "class")= chr "col_spec"
>
> dput(Map1)
> structure(list(ProviderState = c("ALASKA", "ALABAMA", "ARKANSAS",
> "ARIZONA", "CALIFORNIA", "COLORADO", "CONNECTICUT", "DISTRICT OF COLUMBIA",
> "DELAWARE", "FLORIDA", "GEORGIA", "GUAM", "HAWAII", "IOWA", "IDAHO",
> "ILLINOIS", "INDIANA", "KANSAS", "KENTUCKY", "LOUISIANA", "MASSACHUSETTS",
> "MARYLAND", "MAINE", "MICHIGAN", "MINNESOTA", "MISSOURI", "MISSISSIPPI",
> "MONTANA", "NORTH CAROLINA", "NORTH DAKOTA", "NEBRASKA", "NEW HAMPSHIRE",
> "NEW JERSEY", "NEW MEXICO", "NEVADA", "NEW YORK", "OHIO", "OKLAHOMA",
> "OREGON", "PENNSYLVANIA", "PUERTO RICO", "RHODE ISLAND", "SOUTH CAROLINA",
> "SOUTH DAKOTA", "TENNESSEE", "TEXAS", "UTAH", "VIRGINIA", "VIRGIN
ISLANDS",
> "VERMONT", "WASHINGTON", "WISCONSIN", "WEST VIRGINIA", "WYOMING"
> ), ProviderStateCode = c("AK", "AL", "AR", "AZ", "CA", "CO",
> "CT", "DC", "DE", "FL", "GA", "GU", "HI", "IA", "ID", "IL", "IN",
> "KS", "KY", "LA", "MA", "MD", "ME", "MI", "MN", "MO", "MS", "MT",
> "NC", "ND", "NE", "NH", "NJ", "NM", "NV", "NY", "OH", "OK", "OR",
> "PA", "PR", "RI", "SC", "SD", "TN", "TX", "UT", "VA", "VI", "VT",
> "WA", "WI", "WV", "WY"), ProviderRegion = c("Pacific", "South",
> "South", "Pacific", "Pacific", "Frontier", "Northeast", "Northeast",
> "Northeast", "South", "South", "Pacific", "Pacific", "Midwest",
> "Frontier", "Midwest", "Midwest", "Frontier", "South", "South",
> "Northeast", "Northeast", "Northeast", "Midwest", "Midwest",
> "Midwest", "South", "Frontier", "South", "Midwest", "Midwest",
> "Northeast", "Northeast", "Frontier", "Pacific", "Northeast",
> "Midwest", "Frontier", "Pacific", "Northeast", "Northeast", "Northeast",
> "South", "Midwest", "South", "Frontier", "Frontier", "South",
> "Northeast", "Northeast", "Pacific", "Midwest", "South", "Frontier"
> )), row.names = c(NA, -54L), class = c("tbl_df", "tbl", "data.frame"
> ), spec = structure(list(cols = list(ProviderState = structure(list(), class = c("collector_character",
> "collector")), ProviderStateCode = structure(list(), class =
c("collector_character",
> "collector")), ProviderRegion = structure(list(), class =
c("collector_character",
> "collector"))), default = structure(list(), class = c("collector_guess",
> "collector"))), class = "col_spec"))
>
> Thank you for any suggestions.
>
> WHP
>
>
>
>
>
>
> Confidentiality Notice This message is sent from Zelis. ...{{dropped:15}}
>
> _______________________________________________
> R-sig-Geo mailing list
> [hidden email]
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
        [[alternative HTML version deleted]]

_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

Re: st_union crashes RStudio - bug?

Fri, 09/14/2018 - 02:31
Crashes R or Rstudio?

Cheers,
Roman

On Fri, Sep 14, 2018 at 8:33 AM Bertram Ostendorf <
[hidden email]> wrote:

> I am trying to dissolve internal boundaries using sf.  This crashes R in
> the example geojson map below, a simple map of Australia’s states and
> territories. I am using a polygon layer that processes fine in other GIS
> and also works fine using sp (casting to sp and using gUnaryUnion).  I am
> not after a workaround but I'd like to explore what's different in sf and
> why this particular layer causes problems.
>
> My questions: Is this a bug in sf? Have others experienced similar issues
> using simple features?
>
> Thanks
>
> Bertram Ostendorf
> Chair for Spatial Environmental Sciences
> Director: Spatial Information Group
> The University of Adelaide, AUSTRALIA 5005
>
>
> # Here's my example layer and code:
> # Note: Neither ArcGIS ‘repair geometry’ nor  ‘st_is_valid’ show any
> issues.
> library(sf)
> library(ggplot2)
> # read Australia.geojson from dropbox, 15.5Mb
> test <- st_read("
> https://www.dropbox.com/s/060c6lfijyx1e5v/Australia.geojson?dl=1")
> st_is_valid(test)
>
> # The next lines work fine, I added them to illustrate what works
> ggplot(test) + geom_sf(aes(fill=STATE))
> ACT <- test[test$STATE == 'ACT', ]
> NSW <- test[test$STATE == 'NSW', ]
> ACTandNSW <- test[test$STATE %in% c('NSW','ACT'), ]
> noACT <- test[test$STATE != 'ACT', ]
> noNSW <- test[test$STATE != 'NSW', ]
> noACTandNSW <- test[!test$STATE %in% c('NSW','ACT'), ]
> # st_union works ok for most subsets. But note that some internal
> boundaries are not removed.
> ok <- st_union(ACT)
> # donut polygons work fine
> ok <- st_union(NSW)
> # donut polygons (NSW) filled (ACT) work fine
> ok <- st_union(ACTandNSW)
> # all states except NSW work fine
> ok <- st_union(noNSW)
> # ok if both ACT and NSW are removed
> ok <- st_union(noACTandNSW)
> ggplot(ok) + geom_sf()
>
> # Thing go pear-shaped if the hole is filled (ACT in NSW), but only if
> neighbours of the filled donut polygon are present.
> # The two lines below stall R and eventually crash RStudio
> crash <- st_union(test)
> # Australia without its governing territory kills R
> crash <- st_union(noACT)
>
>
> > sessionInfo()
> R version 3.5.1 (2018-07-02)
> Platform: x86_64-w64-mingw32/x64 (64-bit)
> Running under: Windows >= 8 x64 (build 9200)
>
> Matrix products: default
>
> locale:
>   [1] LC_COLLATE=English_Australia.1252  LC_CTYPE=English_Australia.1252
>   LC_MONETARY=English_Australia.1252
> [4] LC_NUMERIC=C                       LC_TIME=English_Australia.1252
>
> attached base packages:
>   [1] stats     graphics  grDevices utils     datasets  methods   base
>
> other attached packages:
>   [1] ggplot2_3.0.0 sf_0.6-3
>
> loaded via a namespace (and not attached):
>   [1] Rcpp_0.12.18     rstudioapi_0.7   bindr_0.1.1      magrittr_1.5
>  units_0.6-0      tidyselect_0.2.4 munsell_0.5.0
> [8] colorspace_1.3-2 R6_2.2.2         rlang_0.2.2      plyr_1.8.4
>  dplyr_0.7.6      tools_3.5.1      grid_3.5.1
> [15] gtable_0.2.0     e1071_1.7-0      DBI_1.0.0        withr_2.1.2
> class_7.3-14     digest_0.6.16    yaml_2.2.0
> [22] lazyeval_0.2.1   assertthat_0.2.0 tibble_1.4.2     crayon_1.3.4
>  bindrcpp_0.2.2   spData_0.2.9.3   purrr_0.2.5
> [29] glue_1.3.0       compiler_3.5.1   pillar_1.3.0     scales_1.0.0
>  classInt_0.2-3   pkgconfig_2.0.2
>
>
>
>
>
>         [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-Geo mailing list
> [hidden email]
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>

--
In God we trust, all others bring data.

        [[alternative HTML version deleted]]

_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

st_union crashes RStudio - bug?

Fri, 09/14/2018 - 01:33
I am trying to dissolve internal boundaries using sf.  This crashes R in the example geojson map below, a simple map of Australia’s states and territories. I am using a polygon layer that processes fine in other GIS and also works fine using sp (casting to sp and using gUnaryUnion).  I am not after a workaround but I'd like to explore what's different in sf and why this particular layer causes problems.

My questions: Is this a bug in sf? Have others experienced similar issues using simple features?

Thanks

Bertram Ostendorf
Chair for Spatial Environmental Sciences
Director: Spatial Information Group
The University of Adelaide, AUSTRALIA 5005


# Here's my example layer and code:
# Note: Neither ArcGIS ‘repair geometry’ nor  ‘st_is_valid’ show any issues.
library(sf)
library(ggplot2)
# read Australia.geojson from dropbox, 15.5Mb
test <- st_read("https://www.dropbox.com/s/060c6lfijyx1e5v/Australia.geojson?dl=1")
st_is_valid(test)

# The next lines work fine, I added them to illustrate what works
ggplot(test) + geom_sf(aes(fill=STATE))
ACT <- test[test$STATE == 'ACT', ]
NSW <- test[test$STATE == 'NSW', ]
ACTandNSW <- test[test$STATE %in% c('NSW','ACT'), ]
noACT <- test[test$STATE != 'ACT', ]
noNSW <- test[test$STATE != 'NSW', ]
noACTandNSW <- test[!test$STATE %in% c('NSW','ACT'), ]
# st_union works ok for most subsets. But note that some internal boundaries are not removed.
ok <- st_union(ACT)
# donut polygons work fine
ok <- st_union(NSW)
# donut polygons (NSW) filled (ACT) work fine
ok <- st_union(ACTandNSW)
# all states except NSW work fine
ok <- st_union(noNSW)
# ok if both ACT and NSW are removed
ok <- st_union(noACTandNSW)
ggplot(ok) + geom_sf()

# Thing go pear-shaped if the hole is filled (ACT in NSW), but only if neighbours of the filled donut polygon are present.
# The two lines below stall R and eventually crash RStudio
crash <- st_union(test)
# Australia without its governing territory kills R
crash <- st_union(noACT)


> sessionInfo()
R version 3.5.1 (2018-07-02)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)

Matrix products: default

locale:
  [1] LC_COLLATE=English_Australia.1252  LC_CTYPE=English_Australia.1252    LC_MONETARY=English_Australia.1252
[4] LC_NUMERIC=C                       LC_TIME=English_Australia.1252

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

other attached packages:
  [1] ggplot2_3.0.0 sf_0.6-3

loaded via a namespace (and not attached):
  [1] Rcpp_0.12.18     rstudioapi_0.7   bindr_0.1.1      magrittr_1.5     units_0.6-0      tidyselect_0.2.4 munsell_0.5.0
[8] colorspace_1.3-2 R6_2.2.2         rlang_0.2.2      plyr_1.8.4       dplyr_0.7.6      tools_3.5.1      grid_3.5.1
[15] gtable_0.2.0     e1071_1.7-0      DBI_1.0.0        withr_2.1.2      class_7.3-14     digest_0.6.16    yaml_2.2.0
[22] lazyeval_0.2.1   assertthat_0.2.0 tibble_1.4.2     crayon_1.3.4     bindrcpp_0.2.2   spData_0.2.9.3   purrr_0.2.5
[29] glue_1.3.0       compiler_3.5.1   pillar_1.3.0     scales_1.0.0     classInt_0.2-3   pkgconfig_2.0.2





        [[alternative HTML version deleted]]

_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

Re: Kriging and plotting categorical variables

Fri, 09/14/2018 - 00:45
As an efficient alternative to kriging you could try using RF with buffer
distances to classes incorporated into the model:

https://peerj.com/articles/5518/

Also described in:

https://envirometrix.github.io/PredictiveSoilMapping/soilmapping-using-mla.html#spatial-prediction-of-soil-types

New kid in the class.

On Fri, Sep 14, 2018, 01:31 Guy Bayegnak <[hidden email]> wrote:

> Dear all,
> I am working with a set of categorical variables labelled: Group1, Group2,
> Group3,  and Group4. I created a new categorical variables where I replaced
> the observation Goup1 to Group4 by 1 to 4.  Then I performed Ordinary
> Kriging on the new variable [1-4].  But the outcome of the kriging ranges
> only from 2.0 to 3.5. Basically Goup1 is lost.
> Please tell me what I am doing wrong. Also please let me know how to do
> interpolation on categorical variables in general.
>
> Thanks,
>
> Guy Bayegnak, M.Sc. P.Geol,
> Supervisor Groundwater Quality
> Senior Hydrogeologist
> Groundwater Policy | Water Policy Branch | Alberta Environment and Parks |
> 780 644 8368
> 7th Floor, Oxbridge Place | 9820 -106 street Edmonton Alberta T5K 2J6 |
> Canada
>
>
> This email and any files transmitted with it are confide...{{dropped:10}}
>
> _______________________________________________
> R-sig-Geo mailing list
> [hidden email]
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>
        [[alternative HTML version deleted]]

_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

Re: Help with simple Map of US states to predefined regions

Thu, 09/13/2018 - 18:51
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 this URL for download
##   https://www.census.gov/cgi-bin/geo/shapefiles/index.php?year=2017&layergroup=States+%28and+equivalent%29

ustf <- readOGR('.', 'tl_2017_us_state', stringsAsFactors=FALSE)

## note, the Tiger file includes 6 additional territories
dim(ustf)
## [1] 56 14

## get rid of the extra six territories  (state.name comes with R)
cus <- subset(ustf, NAME %in% state.name)

## cheap rename
cus$state <- cus$NAME
cus$abb <- cus$STUSPS

## invent ridiculous groupings of states
cus$grp <- 'a'
cus$grp[11:20] <- 'b'
cus$grp[21:30] <- 'c'
cus$grp[31:40] <- 'd'
cus$grp[41:50] <- 'e'

## assign colors to the groups
cus$color <- 'red'
cus$color[cus$grp=='b'] <- 'green'
cus$color[cus$grp=='c'] <- 'blue'
cus$color[cus$grp=='d'] <- 'brown'
cus$color[cus$grp=='e'] <- 'cyan'

## exclude Alaska, Hawaii
cus <- subset(cus, !(state %in% c('Alaska','Hawaii')))

## get rid of extraneous variables (optional)
cus <- cus[ , c('state','REGION','abb', 'grp') ]

## plot colored by regions as defined in the Census Bureau Tiger file
plot(cus, col=cus$REGION, usePolypath=FALSE)
## color "1" is black, looks bad, do this instead
plot(cus, col=as.numeric(cus$REGION)+1, usePolypath=FALSE)
text(coordinates(cus), cus$abb, col='white', cex=0.75)

## colors specified by a color variable in the data
plot(cus, col=cus$color, usePolypath=FALSE)
text(coordinates(cus), cus$abb, col='white', cex=0.75)


--
Don MacQueen
Lawrence Livermore National Laboratory
7000 East Ave., L-627
Livermore, CA 94550
925-423-1062
Lab cell 925-724-7509
 
 

On 9/12/18, 11:27 AM, "R-sig-Geo on behalf of Bill Poling" <[hidden email] on behalf of [hidden email]> wrote:

    Hi
   
    I have this df with three columns ProviderState, ProviderStateCode, ProviderRegion I wanted to use to create a simple 5 color map
   
    I have reviewed fiftystater pkg and map pkg but not sure how to simply take these three columns and plot a simple 5 color map based on the Region the state is in?
   
    After looking at these and trying to apply these ideas to my data
    https://cran.r-project.org/web/packages/fiftystater/vignettes/fiftystater.html
    https://cran.r-project.org/web/packages/maps/maps.pdf
   
    I found tutorial at: https://uchicagoconsulting.wordpress.com/tag/r-ggplot2-maps-visualization/
   
    I used the tutorial data and subset in my regions
   
    So now I have come up with the 5 segmented maps and my question becomes how to put this all into one map of the US?
   
   
    install.packages("maps")
    library(maps)
    library(ggplot2)
   
    #load us map data
    all_states <- map_data("state") View(all_states)
    #plot all states with ggplot
    p <- ggplot()
    p <- p + geom_polygon( data=all_states, aes(x=long, y=lat, group = group),colour="white", fill="blue" )
    p
   
    #http://sape.inf.usi.ch/quick-reference/ggplot2/colour
   
    #Pacificstates
    Pacificstates <- subset(all_states, region %in% c( "alaska", "arizona", "california", "hawaii", "nevada", "oregon","washington") )
    p <- ggplot()
    p <- p + geom_polygon( data=Pacificstates, aes(x=long, y=lat, group = group),colour="white", fill="deepskyblue4" ) +
      labs(title = "Pacificstates")
    p
   
    #Frontierstates
    Frontierstates <- subset(all_states, region %in% c( "colorado", "idaho", "kansas", "montana", "new mexico", "oklahoma","texas", "utah", "wyoming") )
    p <- ggplot()
    p <- p + geom_polygon( data=Frontierstates, aes(x=long, y=lat, group = group),colour="white", fill="dodgerblue1" ) +
          labs(title = "FrontierStates")
    p
   
    #Midweststates
    Midweststates <- subset(all_states, region %in% c( "iowa", "illinois", "indiana", "michigan", "minnesota", "missouri","north dakota", "nebraska", "ohio","south dakota","wisconsin") )
    p <- ggplot()
    p <- p + geom_polygon( data=Midweststates, aes(x=long, y=lat, group = group),colour="white", fill="dodgerblue1" ) +
          labs(title = "MidwestStates")
    p
   
    #Southernstates
    Southernstates <- subset(all_states, region %in% c( "alabama", "arkansas", "florida", "georgia", "kentucky", "louisiana","mississippi"
                                                        ,"north carolina", "south carolina","tennessee","virginia","west virginia") )
    p <- ggplot()
    p <- p + geom_polygon( data=Southernstates, aes(x=long, y=lat, group = group),colour="white", fill="royalblue2" ) +
      labs(title = "Southernstates")
    p
   
    # Northeaststates
    Northeaststates <- subset(all_states, region %in% c( "connecticut", "district of columbia", "delaware", "massachusetts", "maryland", "maine","new hampshire"
                                                         , "new jersey", "new york","pennsylvania","rhode island","vermont") )
    p <- ggplot()
    p <- p + geom_polygon( data=Northeaststates, aes(x=long, y=lat, group = group),colour="white", fill="dodgerblue4" ) +
      labs(title = "Northeaststates")
    p
   
   
    #here is my my data but not used above
   
    str(Map1)
    Classes 'tbl_df', 'tbl' and 'data.frame':    54 obs. of  3 variables:
    $ ProviderState    : chr  "ALASKA" "ALABAMA" "ARKANSAS" "ARIZONA" ...
    $ ProviderStateCode: chr  "AK" "AL" "AR" "AZ" ...
    $ ProviderRegion   : chr  "Pacific" "South" "South" "Pacific" ...
    - attr(*, "spec")=List of 2
      ..$ cols   :List of 3
      .. ..$ ProviderState    : list()
      .. .. ..- attr(*, "class")= chr  "collector_character" "collector"
      .. ..$ ProviderStateCode: list()
      .. .. ..- attr(*, "class")= chr  "collector_character" "collector"
      .. ..$ ProviderRegion   : list()
      .. .. ..- attr(*, "class")= chr  "collector_character" "collector"
      ..$ default: list()
      .. ..- attr(*, "class")= chr  "collector_guess" "collector"
      ..- attr(*, "class")= chr "col_spec"
   
    dput(Map1)
    structure(list(ProviderState = c("ALASKA", "ALABAMA", "ARKANSAS",
    "ARIZONA", "CALIFORNIA", "COLORADO", "CONNECTICUT", "DISTRICT OF COLUMBIA",
    "DELAWARE", "FLORIDA", "GEORGIA", "GUAM", "HAWAII", "IOWA", "IDAHO",
    "ILLINOIS", "INDIANA", "KANSAS", "KENTUCKY", "LOUISIANA", "MASSACHUSETTS",
    "MARYLAND", "MAINE", "MICHIGAN", "MINNESOTA", "MISSOURI", "MISSISSIPPI",
    "MONTANA", "NORTH CAROLINA", "NORTH DAKOTA", "NEBRASKA", "NEW HAMPSHIRE",
    "NEW JERSEY", "NEW MEXICO", "NEVADA", "NEW YORK", "OHIO", "OKLAHOMA",
    "OREGON", "PENNSYLVANIA", "PUERTO RICO", "RHODE ISLAND", "SOUTH CAROLINA",
    "SOUTH DAKOTA", "TENNESSEE", "TEXAS", "UTAH", "VIRGINIA", "VIRGIN ISLANDS",
    "VERMONT", "WASHINGTON", "WISCONSIN", "WEST VIRGINIA", "WYOMING"
    ), ProviderStateCode = c("AK", "AL", "AR", "AZ", "CA", "CO",
    "CT", "DC", "DE", "FL", "GA", "GU", "HI", "IA", "ID", "IL", "IN",
    "KS", "KY", "LA", "MA", "MD", "ME", "MI", "MN", "MO", "MS", "MT",
    "NC", "ND", "NE", "NH", "NJ", "NM", "NV", "NY", "OH", "OK", "OR",
    "PA", "PR", "RI", "SC", "SD", "TN", "TX", "UT", "VA", "VI", "VT",
    "WA", "WI", "WV", "WY"), ProviderRegion = c("Pacific", "South",
    "South", "Pacific", "Pacific", "Frontier", "Northeast", "Northeast",
    "Northeast", "South", "South", "Pacific", "Pacific", "Midwest",
    "Frontier", "Midwest", "Midwest", "Frontier", "South", "South",
    "Northeast", "Northeast", "Northeast", "Midwest", "Midwest",
    "Midwest", "South", "Frontier", "South", "Midwest", "Midwest",
    "Northeast", "Northeast", "Frontier", "Pacific", "Northeast",
    "Midwest", "Frontier", "Pacific", "Northeast", "Northeast", "Northeast",
    "South", "Midwest", "South", "Frontier", "Frontier", "South",
    "Northeast", "Northeast", "Pacific", "Midwest", "South", "Frontier"
    )), row.names = c(NA, -54L), class = c("tbl_df", "tbl", "data.frame"
    ), spec = structure(list(cols = list(ProviderState = structure(list(), class = c("collector_character",
    "collector")), ProviderStateCode = structure(list(), class = c("collector_character",
    "collector")), ProviderRegion = structure(list(), class = c("collector_character",
    "collector"))), default = structure(list(), class = c("collector_guess",
    "collector"))), class = "col_spec"))
   
    Thank you for any suggestions.
   
    WHP
   
   
   
   
   
   
    Confidentiality Notice This message is sent from Zelis. ...{{dropped:15}}
   
    _______________________________________________
    R-sig-Geo mailing list
    [hidden email]
    https://stat.ethz.ch/mailman/listinfo/r-sig-geo
   

_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

Kriging and plotting categorical variables

Thu, 09/13/2018 - 18:31
Dear all,
I am working with a set of categorical variables labelled: Group1, Group2, Group3,  and Group4. I created a new categorical variables where I replaced the observation Goup1 to Group4 by 1 to 4.  Then I performed Ordinary Kriging on the new variable [1-4].  But the outcome of the kriging ranges only from 2.0 to 3.5. Basically Goup1 is lost.
Please tell me what I am doing wrong. Also please let me know how to do interpolation on categorical variables in general.

Thanks,

Guy Bayegnak, M.Sc. P.Geol,
Supervisor Groundwater Quality
Senior Hydrogeologist
Groundwater Policy | Water Policy Branch | Alberta Environment and Parks | 780 644 8368
7th Floor, Oxbridge Place | 9820 -106 street Edmonton Alberta T5K 2J6 | Canada


This email and any files transmitted with it are confide...{{dropped:10}}

_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

Re: Help with simple Map of US states with predefined regions Version 2

Thu, 09/13/2018 - 15:40
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 Tiger file -- polygons of each US State
## try this URL for download
##      https://www.census.gov/cgi-bin/geo/shapefiles/index.php?year=2017&layergroup=States+%28and+equivalent%29

## unzip to working directory ( '.' )
ustf <- readOGR('.', 'tl_2017_us_state', stringsAsFactors=FALSE)

## note, the Tiger file includes 6 additional territories
dim(ustf)
## [1] 56 14

## get rid of the extra six territories  (state.name comes with R)
cus <- subset(ustf, NAME %in% state.name)

## cheap rename
cus$state <- cus$NAME
cus$abb <- cus$STUSPS

## invent ridiculous groupings of states
cus$grp <- 'a'
cus$grp[11:20] <- 'b'
cus$grp[21:30] <- 'c'
cus$grp[31:40] <- 'd'
cus$grp[41:50] <- 'e'

## assign colors to the groups
cus$color <- 'red'
cus$color[cus$grp=='b'] <- 'green'
cus$color[cus$grp=='c'] <- 'blue'
cus$color[cus$grp=='d'] <- 'brown'
cus$color[cus$grp=='e'] <- 'cyan'

## exclude Alaska, Hawaii
cus <- subset(cus, !(state %in% c('Alaska','Hawaii')))

## get rid of extraneous variables (optional)
cus <- cus[ , c('state','REGION','abb', 'grp') ]

## plot colored by regions as defined in the Census Bureau Tiger file
plot(cus, col=cus$REGION, usePolypath=FALSE)

## color "1" is black, looks bad, do this instead
plot(cus, col=as.numeric(cus$REGION)+1, usePolypath=FALSE)
text(coordinates(cus), cus$abb, col='white', cex=0.75)

## colors specified by a color variable in the data
plot(cus, col=cus$color, usePolypath=FALSE)
text(coordinates(cus), cus$abb, col='white', cex=0.75)

(my preferred graphics device does not support Polypath, but probably most others do, so one can omit usePolypath=FALSE)

-Don

--
Don MacQueen
Lawrence Livermore National Laboratory
7000 East Ave., L-627
Livermore, CA 94550
925-423-1062
Lab cell 925-724-7509
 
 

On 9/13/18, 5:17 AM, "R-sig-Geo on behalf of Bill Poling" <[hidden email] on behalf of [hidden email]> wrote:

    Hi,
   
    I hope someone can help me finalize this please.
   
    I am coming close to what I need using variations from two ggplot2 tutorials.
   
    This first gives me the map of the US with AK & HI but I cannot figure out how to get my 5 regions colored
   
    #https://stackoverflow.com/questions/38021188/how-to-draw-u-s-state-map-with-hi-and-ak-with-state-abbreviations-centered-us?rq=1
   
   
    library(ggplot2)
    install.packages("ggalt")
    library(ggalt)     # coord_proj
    library(albersusa) # devtools::install_github("hrbrmstr/albersusa")
    install.packages("ggthemes")
    library(ggthemes)  # theme_map
    install.packages("rgeos")
    library(rgeos)     # centroids
    library(dplyr)
   
    # composite map with AK & HI
    usa_map <- usa_composite()
   
    # calculate the centroids for each state gCentroid(usa_map, byid=TRUE) %>%
      as.data.frame() %>%
      mutate(state=usa_map@data$iso_3166_2) -> centroids
   
    # make it usable in ggplot2
    usa_map <- fortify(usa_map)
   
    View(usa_map)
    t1 <- head(usa_map,n=5)
    knitr::kable(t1, row.names=FALSE, align=c("l", "l", "r", "r", "r"))
   
    #
   
      # |long      |lat      | group| order|  region|subregion |
      # |:---------|:--------|-----:|-----:|-------:|:---------|
      # |-87.46201 |30.38968 |     1|     1| alabama|NA        |
      # |-87.48493 |30.37249 |     1|     2| alabama|NA        |
      # |-87.52503 |30.37249 |     1|     3| alabama|NA        |
      # |-87.53076 |30.33239 |     1|     4| alabama|NA        |
      # |-87.57087 |30.32665 |     1|     5| alabama|NA        |
   
    usa_map <- fortify(usa_map)
    gg <- ggplot()
    gg <- gg + geom_map(data=usa_map, map=usa_map,
                        aes(long, lat, map_id=id),
                        color="#2b2b2b", size=0.1, fill=NA)
   
    gg <- gg + geom_text(data=centroids, aes(x, y, label=state), size=2) gg <- gg + coord_proj(us_laea_proj) gg <- gg + theme_map() gg
   
   
   
   
    #************************************************************************************************************************************************************************************/
   
    This second is an alternative (however not liking AK&HI, not coming into the map like scenario one above) but also ignoring new Mexico (because recognizing a seventh field value) and I suspect it will do the same for new York and new jersey etc.. when I add them to the list.
   
    Error in scan(file = file, what = what, sep = sep, quote = quote, dec = dec,  :  line 12 did not have 6 elements
   
    When I use newmexico (all one word) it appears white in the map like the other states not in the table statement
   
    #https://stackoverflow.com/questions/38777732/r-code-to-generating-map-of-us-states-with-specific-colors
   
    library(ggplot2)
   
    read.table(text="State.Code   region            St_Abbr   Num_Estab  colors
                          1          1   alaska       Ak        13123    #f7931e
                          3          1   arizona      AZ        18053    #f7931e
                          5          1   california   CA       143937    #f7931e
                          2          1   hawaii       HI       123456    #f7931e
                          4          1   nevada       NV       654321    #f7931e
                          6          1   oregon       OR       321456    #f7931e
                          7          1   washington   WA       456123    #f7931e
                          8          2   colorado     CO       987654    #787878
                          9          2   idaho        ID       13549     #787878
                         10          2   kansas       KS       94531     #787878
                         11          2   montana      MT       456321    #787878
                         12          2   new mexico   NM     582310            #787878 <---Not liking new mexico, saying not 6
                         13          2   oklahoma     OK       214567    #787878
                         14          2   texas        TX       675421    #787878
                         15          2   utah         UT       754321    #787878
                         16          2   wyoming      WY       543124    #787878 ",
    stringsAsFactors=FALSE, header=TRUE, comment.char="") -> df
   
    usa_map1 <- map_data("state")
    t1 <- head(usa_map1,n=5)
    knitr::kable(t1, row.names=FALSE, align=c("l", "l", "r", "r", "r"))
    View(usa_map1)
    #
    #   |long      |lat      | group| order|  region|subregion |
    #   |:---------|:--------|-----:|-----:|-------:|:---------|
    #   |-87.46201 |30.38968 |     1|     1| alabama|NA        |
    #   |-87.48493 |30.37249 |     1|     2| alabama|NA        |
    #   |-87.52503 |30.37249 |     1|     3| alabama|NA        |
    #   |-87.53076 |30.33239 |     1|     4| alabama|NA        |
    #   |-87.57087 |30.32665 |     1|     5| alabama|NA        |
   
   
   
    gg <- ggplot()
    #View(gg)
    gg <- gg + geom_map(data=usa_map1, map=usa_map1,
                        aes(long, lat, map_id=region),
                        color="#2b2b2b", size=0.15, fill=NA)
   
    gg <- gg + geom_map(data=df, map=usa_map1,
                        aes(fill=colors, map_id=region),
                        color="#2b2b2b", size=0.15)
   
   
    gg <- gg + geom_text(data=centroids, aes(x, y, label=state), size=2) gg <- gg + coord_proj(us_laea_proj) gg <- gg + theme_map() gg
   
   
    gg <- gg + scale_color_identity()
    gg <- gg + coord_map("polyconic")
    gg <- gg + ggthemes::theme_map()
    gg
   
    #c( "colorado", "idaho", "kansas", "montana", "new mexico", "oklahoma","texas", "utah", "wyoming") ) #c("alaska", "arizona", "california", "hawaii", "nevada", "oregon","washington"))
   
   
   
    William H. Poling, Ph.D., MPH
   
   
   
   
    Confidentiality Notice This message is sent from Zelis. ...{{dropped:13}}
   
    _______________________________________________
    R-sig-Geo mailing list
    [hidden email]
    https://stat.ethz.ch/mailman/listinfo/r-sig-geo
   

_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

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

Thu, 09/13/2018 - 13:31
Thank you Jeff.

Cannot seem to get this to work in the fashion I want it to appear no matter how many websites and packages I investigate.

Letting it go for the moment.

Always appreciate your advice Sir!

WHP
From: Jeff Newmiller <[hidden email]>
Sent: Thursday, September 13, 2018 10:29 AM
To: [hidden email]; Bill Poling <[hidden email]>; r-help ([hidden email]) <[hidden email]>
Subject: Re: [R] Help with simple Map of US states with predefined regions Version 2

Your data appear to be in fixed format, not space-delimited (or delimited by any other special character), so you should use read.fwf to read it in rather that read.table.

?read.fwf

In the future you should try to identify where your errors are or your data don't look right and ask focused questions about that (reproducible) problem rather than spilling your whole script into an email. That is, your error occurred in the single read.table command and the rest of it was working fine.

On September 13, 2018 5:14:33 AM PDT, Bill Poling <[hidden email]<mailto:[hidden email]>> wrote:
>Hi,
>
>I hope someone can help me finalize this please.
>
>I am coming close to what I need using variations from two ggplot2
>tutorials.
>
>This first gives me the map of the US with AK & HI but I cannot figure
>out how to get my 5 regions colored
>
>#https://stackoverflow.com/questions/38021188/how-to-draw-u-s-state-map-with-hi-and-ak-with-state-abbreviations-centered-us?rq=1<https://stackoverflow.com/questions/38021188/how-to-draw-u-s-state-map-with-hi-and-ak-with-state-abbreviations-centered-us?rq=1>
>
>
>library(ggplot2)
>install.packages("ggalt")
>library(ggalt) # coord_proj
>library(albersusa) # devtools::install_github("hrbrmstr/albersusa")
>install.packages("ggthemes")
>library(ggthemes) # theme_map
>install.packages("rgeos")
>library(rgeos) # centroids
>library(dplyr)
>
># composite map with AK & HI
>usa_map <- usa_composite()
>
># calculate the centroids for each state
>gCentroid(usa_map, byid=TRUE) %>%
> as.data.frame() %>%
> mutate(state=usa_map@data$iso_3166_2) -> centroids
>
># make it usable in ggplot2
>usa_map <- fortify(usa_map)
>
>View(usa_map)
>t1 <- head(usa_map,n=5)
>knitr::kable(t1, row.names=FALSE, align=c("l", "l", "r", "r", "r"))
>
>#
>
> # |long |lat | group| order| region|subregion |
> # |:---------|:--------|-----:|-----:|-------:|:---------|
> # |-87.46201 |30.38968 | 1| 1| alabama|NA |
> # |-87.48493 |30.37249 | 1| 2| alabama|NA |
> # |-87.52503 |30.37249 | 1| 3| alabama|NA |
> # |-87.53076 |30.33239 | 1| 4| alabama|NA |
> # |-87.57087 |30.32665 | 1| 5| alabama|NA |
>
>usa_map <- fortify(usa_map)
>gg <- ggplot()
>gg <- gg + geom_map(data=usa_map, map=usa_map,
> aes(long, lat, map_id=id),
> color="#2b2b2b", size=0.1, fill=NA)
>
>gg <- gg + geom_text(data=centroids, aes(x, y, label=state), size=2)
>gg <- gg + coord_proj(us_laea_proj)
>gg <- gg + theme_map()
>gg
>
>
>
>
>#************************************************************************************************************************************************************************************/
>
>This second is an alternative (however not liking AK&HI, not coming
>into the map like scenario one above) but also ignoring new Mexico
>(because recognizing a seventh field value) and I suspect it will do
>the same for new York and new jersey etc.. when I add them to the list.
>
>Error in scan(file = file, what = what, sep = sep, quote = quote, dec =
>dec, : line 12 did not have 6 elements
>
>When I use newmexico (all one word) it appears white in the map like
>the other states not in the table statement
>
>#https://stackoverflow.com/questions/38777732/r-code-to-generating-map-of-us-states-with-specific-colors<https://stackoverflow.com/questions/38777732/r-code-to-generating-map-of-us-states-with-specific-colors>
>
>library(ggplot2)
>
>read.table(text="State.Code region St_Abbr Num_Estab
>colors
> 1 1 alaska Ak 13123 #f7931e
> 3 1 arizona AZ 18053 #f7931e
> 5 1 california CA 143937 #f7931e
> 2 1 hawaii HI 123456 #f7931e
> 4 1 nevada NV 654321 #f7931e
> 6 1 oregon OR 321456 #f7931e
> 7 1 washington WA 456123 #f7931e
> 8 2 colorado CO 987654 #787878
> 9 2 idaho ID 13549 #787878
> 10 2 kansas KS 94531 #787878
> 11 2 montana MT 456321 #787878
>12 2 new mexico NM 582310 #787878 <---Not
>liking new mexico, saying not 6
> 13 2 oklahoma OK 214567 #787878
> 14 2 texas TX 675421 #787878
> 15 2 utah UT 754321 #787878
> 16 2 wyoming WY 543124 #787878 ",
>stringsAsFactors=FALSE, header=TRUE, comment.char="") -> df
>
>usa_map1 <- map_data("state")
>t1 <- head(usa_map1,n=5)
>knitr::kable(t1, row.names=FALSE, align=c("l", "l", "r", "r", "r"))
>View(usa_map1)
>#
># |long |lat | group| order| region|subregion |
># |:---------|:--------|-----:|-----:|-------:|:---------|
># |-87.46201 |30.38968 | 1| 1| alabama|NA |
># |-87.48493 |30.37249 | 1| 2| alabama|NA |
># |-87.52503 |30.37249 | 1| 3| alabama|NA |
># |-87.53076 |30.33239 | 1| 4| alabama|NA |
># |-87.57087 |30.32665 | 1| 5| alabama|NA |
>
>
>
>gg <- ggplot()
>#View(gg)
>gg <- gg + geom_map(data=usa_map1, map=usa_map1,
> aes(long, lat, map_id=region),
> color="#2b2b2b", size=0.15, fill=NA)
>
>gg <- gg + geom_map(data=df, map=usa_map1,
> aes(fill=colors, map_id=region),
> color="#2b2b2b", size=0.15)
>
>
>gg <- gg + geom_text(data=centroids, aes(x, y, label=state), size=2)
>gg <- gg + coord_proj(us_laea_proj)
>gg <- gg + theme_map()
>gg
>
>
>gg <- gg + scale_color_identity()
>gg <- gg + coord_map("polyconic")
>gg <- gg + ggthemes::theme_map()
>gg
>
>#c( "colorado", "idaho", "kansas", "montana", "new mexico",
>"oklahoma","texas", "utah", "wyoming") )
>#c("alaska", "arizona", "california", "hawaii", "nevada",
>"oregon","washington"))
>
>
>
>William H. Poling, Ph.D., MPH
>
>
>
>
>Confidentiality Notice This message is sent from Zelis.
>...{{dropped:13}}
>
>______________________________________________
>[hidden email]<mailto:[hidden email]> mailing list -- To UNSUBSCRIBE and more, see
>https://stat.ethz.ch/mailman/listinfo/r-help<https://stat.ethz.ch/mailman/listinfo/r-help>
>PLEASE do read the posting guide
>http://www.R-project.org/posting-guide.html<http://www.R-project.org/posting-guide.html>
>and provide commented, minimal, self-contained, reproducible code.
--
Sent from my phone. Please excuse my brevity.

Confidentiality Notice This message is sent from Zelis. This transmission may contain information which is privileged and confidential and is intended for the personal and confidential use of the named recipient only. Such information may be protected by applicable State and Federal laws from this disclosure or unauthorized use. If the reader of this message is not the intended recipient, or the employee or agent responsible for delivering the message to the intended recipient, you are hereby notified that any disclosure, review, discussion, copying, or taking any action in reliance on the contents of this transmission is strictly prohibited. If you have received this transmission in error, please contact the sender immediately. Zelis, 2018.

        [[alternative HTML version deleted]]

_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

Pages