---
title: "iemiscdata: Map of the Sampled US Locations after the Fukushima Power Plant Explosions in 2011"
date: today
date-format: D MMMM YYYY  
author:
  - name: Irucka Embry
    affiliation: 
      - name: EcoC&sup2;S
        city: Nashville
        state: TN
        url: https://www.ecoccs.com
    degrees:
      - EIT
      - ME
lang: en-US
dir: ltr
format:
  pdf:
    pdf-standard: a-3u
    toc: true
    toc-title: Table of Contents
    papersize: letter
    margin-left: 0.79in
    margin-right: 0.79in
    mainfont: FreeSerif
    sansfont: FreeSans
    monofont: FreeMono
    code-line-numbers: true
    syntax-highlighting: kate
    colorlinks: true
    fontsize: 12pt
    author-meta: "Irucka Embry, Eco-Creative Consulting Services, EcoC^2^S"
vignette: >
  %\VignetteIndexEntry{iemiscdata Map of the Sampled US Locations after the Fukushima Power Plant Explosions in 2011}
  %\VignetteEngine{quarto::pdf}
  %\VignetteEncoding{UTF-8}
---

\bigskip

# Creating a ggplot2 Map of the 2011 Fukushima Radiation Sample Sites

```{r}
#| warning: false
#| message: false
#| fig.align: "center"
#| fig-width: 30
#| fig-height: 26
#| label: fig-fukrad
#| fig-alt: "Map of the 2011 Fukushima Radiation Sample Sites"

install.load::load_package("iemiscdata", "USA.state.boundaries", "data.table", "ggplot2", "sf")
# load needed packages using the load_package function from the install.load package
# (it is assumed that you have already installed these packages)

# load the raddata_US_Fukushima_2011 data from iemiscdata {containing the US EPA
# Envirofacts RadNet (Radiation in the US)}
data(raddata_US_Fukushima_2011, package = "iemiscdata")

# load the state_boundaries_wgs84 data from USA.state.boundaries (for the US map)
data(state_boundaries_wgs84, package = "USA.state.boundaries")



# remove the missing rows with location information missing
raddata_US_Fukushima_2011 <-
raddata_US_Fukushima_2011[-which(is.na(raddata_US_Fukushima_2011$"Location 1 (Longitude)") | is.na(raddata_US_Fukushima_2011$"Location 1 (Latitude)")), ]




## USA

USA <- state_boundaries_wgs84
# create the USA object with the same data as state_boundaries_wgs84

USA_projected <- sf::st_transform(USA, "+proj=aea +lat_1=29.5 +lat_2=45.5 +lat_0=23
+lon_0=-96 +x_0=0 +y_0=0 +datum=NAD83 +units=m +no_defs +ellps=GRS80 +towgs84=0,0,0")
# transform the coordinates to match those of the USA_state_boundaries_map data from
# USA.state.boundaries.data (formerly in USA.state.boundaries)


locations <- sf::st_as_sf(raddata_US_Fukushima_2011, coords = c("Location 1 (Longitude)", "Location 1 (Latitude)"), crs = "+proj=longlat +datum=WGS84 +ellps=WGS84")
# set the projection to longlat using sf


# due to an error message appearing in the tests-MKL, the following code has been added
if (any(st_is_valid(locations)) == FALSE) {

locations <- st_make_valid(locations)

}



# plot the map using ggplot2
p <- ggplot2::ggplot() + geom_sf(data = USA, color = "black", fill = "white")
p <- p + geom_sf(data = locations, color = "#3591d1", size = 0.5) + coord_sf(xlim = c(-60, -170), ylim = c(0, 80), expand = FALSE)
# Source 1
p <- p + ggplot2::labs(x = "", y = "", title = "2011 Fukushima Radiation Sample Locations within the USA")
print(p)
```

\bigskip
\bigskip

# R Source

How to map data with R: A hands-on tutorial to get you to start creating maps with R. By Abhinav Malasi, Jun 29, 2021. See <https://medium.com/geekculture/how-to-map-data-with-r-8333110dff5b>  

\bigskip
\bigskip

# EcoC^2^S Links

EcoC^2^S Home --- <https://www.ecoccs.com>  
About EcoC^2^S --- <https://www.ecoccs.com/about-ecoc2s.html>  
Services --- <https://www.ecoccs.com/services.html>  
EcoC²S / QUP Shop --- <https://www.ecoccs.com/shopeq/>  
Media --- <https://www.ecoccs.com/media.html>  
Book Search --- <https://www.ecoccs.com/book-search.html>  
R Trainings and Resources provided by EcoC^2^S (Irucka Embry, EIT) --- <https://www.ecoccs.com/rtraining.html> 

\bigskip
\bigskip

# Donations accepted with Liberapay

If you would like to contribute to the continued development of [Irucka Embry&#8217;s R packages](https://www.ecoccs.com/rtraining.html#repos) and/or [Irucka Embry&#8217;s R Examples](https://www.ecoccs.com/rtraining.html#examp), please feel free to donate via the link below:  

[https://liberapay.com/iaembry/donate](https://liberapay.com/iaembry/donate)  

Please feel free to review [Irucka Embry (iaembry)&#8217;s profile](https://liberapay.com/iaembry/) on [Liberapay](https://liberapay.com).  

\bigskip
\bigskip

# Copyright and License

All R code written by Irucka Embry is distributed under the GPL-3 (or later) license, see the [GNU General Public License {GPL} page](https://www.gnu.org/licenses/gpl-3.0.html).  

All written content originally created by Irucka Embry is copyrighted under the Creative Commons Attribution-ShareAlike 4.0 International license. All other written content retains the copyright of the original author(s).  

This work is licensed under a [Creative Commons Attribution-ShareAlike 4.0 International license](https://creativecommons.org/licenses/by-sa/4.0/).  
