Skip to content

Commit

Permalink
Clean up documentation and comments.
Browse files Browse the repository at this point in the history
Fixes #2
  • Loading branch information
rplzzz committed May 26, 2017
1 parent 12c29d2 commit f3419c2
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 28 deletions.
4 changes: 4 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,7 @@

# Travis configuration file
.travis.yml

# License and readme
LICENSE.md
README.md
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
notifications:
email:
- robert.link@pnnl.gov
# - catherine.ledna@pnnl.gov

language: r
warnings_are_errors: false
Expand Down
18 changes: 11 additions & 7 deletions R/Map_Functions.R
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ theme_GCAM <- function(base_size = 11, base_family = "", legend = F) {
#'
#' For specifying the projection you can use any Proj4 string.
#' Projections specified this way are computed using
#' \code{ggalt::coord_proj}. For convenience, this package
#' \code{\link[ggalt]{coord_proj}}. For convenience, this package
#' defines the following proj4 strings:
#' \itemize{
#' \item \code{\link{eck3}} - Eckert III
Expand All @@ -431,7 +431,7 @@ theme_GCAM <- function(base_size = 11, base_family = "", legend = F) {
#' }
#'
#' For orthographic projections, we compute the projection using the
#' \code{mapproj::coord_map} function. To get this projection
#' \code{\link[ggplot2]{coord_map}} function. To get this projection
#' pass the \code{\link{ortho}} symbol as the \code{proj} argument.
#' You will then need to pass a vector in the \code{orientation}
#' argument. We have defined the following fequently used orientation
Expand Down Expand Up @@ -487,8 +487,9 @@ theme_GCAM <- function(base_size = 11, base_family = "", legend = F) {
#' @param ... Other parameters passed on to \code{colorfcn}.
#' @examples \dontrun{
#'
#' ##Plot a map of GCAM regions; color it with a palette based on RColorBrewer's 'Set3' palette.
#' map_32_wo_Taiwan<-rgdal::readOGR(system.file('extdata/rgn32', 'GCAM_32_wo_Taiwan_clean.geojson',
#' ## Plot a map of GCAM regions; color it with a palette based on RColorBrewer's 'Set3' palette.
#' map_32_wo_Taiwan<-rgdal::readOGR(system.file('extdata/rgn32',
#' 'GCAM_32_wo_Taiwan_clean.geojson',
#' package='gcammaptools'))
#' map_32_wo_Taiwan.fort<-ggplot2::fortify(map_32_wo_Taiwan, region='GCAM_ID')
#' mp1<-plot_GCAM(map_32_wo_Taiwan.fort, col = 'id', proj = eck3, colorfcn=qualPalette)
Expand All @@ -497,9 +498,12 @@ theme_GCAM <- function(base_size = 11, base_family = "", legend = F) {
#' tables<-parse_mi_output(fn = system.file('extdata','sample-batch.csv',package='gcammaptools'))
#' prim_en<-process_batch_q(tables, 'primary_energy', 'Reference', c(fuel='a oil'))
#' prim_en<-addRegionID(prim_en, file.path(basedir.viz,
#' system.file('extdata/rgn32', 'lookup.txt', package='gcammaptools'),
#' system.file('extdata/rgn32', 'drop-regions.txt', package='gcammaptools')))
#' mp2<-plot_GCAM(map_primen, col = 'X2050', colors = c('white', 'red'), title='Robinson World', qtitle='Oil Consumption, 2050', legend=T)
#' system.file('extdata/rgn32', 'lookup.txt',
#' package='gcammaptools'),
#' system.file('extdata/rgn32',
#' 'drop-regions.txt', package='gcammaptools')))
#' mp2<-plot_GCAM(map_primen, col = 'X2050', colors = c('white', 'red'),
#' title='Robinson World', qtitle='Oil Consumption, 2050', legend=T)
#' }
#' @export
plot_GCAM <- function(mapdata, col = NULL, proj = robin, extent = EXTENT_WORLD,
Expand Down
18 changes: 1 addition & 17 deletions R/diag_header.R
Original file line number Diff line number Diff line change
Expand Up @@ -38,22 +38,6 @@
# Ben Bond-Lamberty, November 2012


# -----------------------------------------------------------------------------
# Load required libraries
# NB this diag has been tested with the following libraries:
# rgdal 1.1-3
# ggplot2 2.1.0
# ggalt # must install the github version: install_github('hrbrmstr/ggalt')
# graticule 0.1.0
# rgeos 0.3-15
# maptools 0.8-37 , "gpclib"
# gpclib [[???]]
# sp 1.2-1
# mapproj 1.2-4
# RColorBrewer 1.1-2
# dplyr 0.5.0


# -----------------------------------------------------------------------------
# Global settings (in CAPITALS)
# This first group of settings is protected--we don't want it re-set every time
Expand Down Expand Up @@ -218,7 +202,7 @@ ch_aea <- "+proj=aea +lat_1=27 +lat_2=45 +x_0=0 +y_0=0 +lat_0=35 +lon_0=105 +ell
#' Projection string for orthographic projections
#'
#' Unlike most projections, the orthographic does not use proj4; it
#' uses the \code{mapproj::coord_map} function. You can pass
#' uses the \code{\link[ggplot2]{coord_map}} function. You can pass
#' this value to the \code{proj} argument of \code{\link{plot_GCAM}}
#' to get an orthographic projection.
#' @export
Expand Down
2 changes: 1 addition & 1 deletion man/ortho.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/plot_GCAM.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit f3419c2

Please sign in to comment.