You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Bob Rudis 0abf848fb5
map & logo
9 years ago
R updated examples 9 years ago
data updated examples 9 years ago
inst/geojson pre-release commit 9 years ago
man updated examples 9 years ago
tests pre-release commit 9 years ago
.Rbuildignore map & logo 9 years ago
.gitignore Initial commit 9 years ago
.travis.yml pre-release commit 9 years ago
CONDUCT.md pre-release commit 9 years ago
DESCRIPTION updated examples 9 years ago
LICENSE Initial commit 9 years ago
NAMESPACE pre-release commit 9 years ago
README-map-1.png map & logo 9 years ago
README-unnamed-chunk-5-1.png pre-release commit 9 years ago
README-unnamed-chunk-6-1.png updated examples 9 years ago
README.Rmd map & logo 9 years ago
README.md map & logo 9 years ago
asam.Rproj pre-release commit 9 years ago
asam.png map & logo 9 years ago
subregions.geojson pre-release commit 9 years ago

README.md

asam is an R package providing tools to access, download, update, process and visualize Anti-shipping Activity Messages (ASAM) Database Files

Anti-shipping Activity Messages (ASAM) include the locations and descriptive accounts of specific hostile acts against ships and mariners. The reports may be useful for recognition, prevention and avoidance of potential hostile activity. The 'asam' package provides a snapshot of the official ASAM database, utilities to update the local database and the official polygons defining the ASAM global regions and subregions.

The following functions are implemented:

  • asam_refresh: Refresh ASAM database
  • asam_shp: ASAM (Anti-shipping Activity Messages) Data (shapefile)
  • asam_subregions: Retrieve ASAM subregions polygons

The following data sets are included:

  • data(asam_shp) : Snapshot of the ASAM dataset
  • system.file("geojson/asam.geojson", package="asam") : Official ASAM regions & subregions shapefile

News

  • Version 0.0.0.9000 released

Installation

devtools::install_github("hrbrmstr/asam")

Usage

library(asam)

# current verison
packageVersion("asam")
#> [1] '0.0.0.9000'

Test Results

library(asam)
library(testthat)
library(sp)
library(ggplot2)
library(ggthemes)
#> Warning: replacing previous import by 'grid::arrow' when loading 'ggthemes'
#> Warning: replacing previous import by 'grid::unit' when loading 'ggthemes'
#> Warning: replacing previous import by 'scales::alpha' when loading 'ggthemes'

date()
#> [1] "Sat Sep 19 14:51:00 2015"

See the subregion map

subregions <- asam_subregions()
plot(subregions)

Find all the incidents by pirates this year

data(asam_shp)
pirates <- subset(asam_shp,
                  grepl("pirate", Aggressor, ignore.case=TRUE) &
                  format(DateOfOcc, "%Y") == "2015")

and plot them

subregions_map <- fortify(subregions)
#> Regions defined for each Polygons
world <- map_data("world")
pirate_pts <- data.frame(pirates)

gg <- ggplot()
gg <- gg + geom_map(data=world, map=world,
                    aes(x=long, y=lat, map_id=region),
                    color="black", fill="#e7e7e7", size=0.15)
gg <- gg + geom_map(data=subregions_map, map=subregions_map,
                    aes(x=long, y=lat, map_id=id),
                    color="white", fill="white", size=0.15, alpha=0)
gg <- gg + geom_point(data=pirate_pts, color="black", fill="yellow", 
                      aes(x=coords.x1, y=coords.x2), shape=21)
gg <- gg + xlim(-170, 170)
gg <- gg + ylim(-58, 75)
gg <- gg + coord_map("mollweide")
gg <- gg + theme_map()
gg <- gg + theme(panel.background=element_rect(fill="steelblue"))
gg

test_dir("tests/")
#> testthat results ========================================================================================================
#> OK: 0 SKIPPED: 0 FAILED: 0
#> 
#> DONE

Code of Conduct

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.