15 changed files with 181 additions and 132 deletions
@ -1,6 +1,7 @@ |
|||
^.*\.Rproj$ |
|||
^\.Rproj\.user$ |
|||
^_README.Rmd$ |
|||
^_README.md$ |
|||
^NEWS.md$ |
|||
^\.travis\.yml$ |
|||
^README.md$ |
|||
|
@ -0,0 +1,20 @@ |
|||
#' @title state_coords |
|||
#' @description simple coordinates for states to use in a 'statebin' plot |
|||
#' \itemize{ |
|||
#' \item \code{abbrev}. state abbreviation, including \code{DC} (chr) |
|||
#' \item \code{state}. capitalized state name (chr) |
|||
#' \item \code{col}. colum where it fits (12x8 grid) (chr) |
|||
#' \item \code{row}. row where it fits (12x8 grid) (chr) |
|||
#' } |
|||
#' |
|||
#' @docType data |
|||
#' @keywords datasets |
|||
#' @name state_coords |
|||
#' @seealso \itemize{ |
|||
#' \item WaPo - \url{http://www.washingtonpost.com/wp-srv/special/business/states-most-threatened-by-trade/} |
|||
#' } |
|||
#' @note Last updated 2014-08-25 |
|||
#' @format A data frame with 51 rows and 4 variables |
|||
NULL |
|||
|
|||
|
@ -1,75 +0,0 @@ |
|||
statesquares is ... |
|||
|
|||
The following functions are implemented: |
|||
|
|||
- `statebins` - |
|||
|
|||
### News |
|||
|
|||
- Version `1.0.0` released |
|||
|
|||
### Installation |
|||
|
|||
``` {.r} |
|||
devtools::install_github("hrbrmstr/statebins") |
|||
``` |
|||
|
|||
### Usage |
|||
|
|||
``` {.r} |
|||
library(statebins) |
|||
``` |
|||
|
|||
## Loading required package: ggplot2 |
|||
## Loading required package: grid |
|||
## Loading required package: scales |
|||
## Loading required package: gridExtra |
|||
|
|||
``` {.r} |
|||
# current verison |
|||
packageVersion("statebins") |
|||
``` |
|||
|
|||
## [1] '1.0' |
|||
|
|||
``` {.r} |
|||
dat <- read.csv("http://www.washingtonpost.com/wp-srv/special/business/states-most-threatened-by-trade/states.csv?cache=1", stringsAsFactors=FALSE) |
|||
|
|||
gg <- statebins(dat, "state", "avgshare94_00", breaks=4, |
|||
labels=c("0-1", "1-2", "2-3", "3-4"), |
|||
legend_title="State Groups", |
|||
brewer_pal="Blues", text_color="black", |
|||
plot_title="1994-2000", title_position="bottom") |
|||
|
|||
gg |
|||
``` |
|||
|
|||
 |
|||
|
|||
``` {.r} |
|||
gg2 <- statebins_continuous(dat, "state", "avgshare01_07", |
|||
legend_title="States", legend_position="none", |
|||
brewer_pal="OrRd", text_color="black", |
|||
plot_title="1994-2000", title_position="bottom") |
|||
|
|||
gg2 |
|||
``` |
|||
|
|||
 |
|||
|
|||
### Test Results |
|||
|
|||
``` {.r} |
|||
library(statebins) |
|||
library(testthat) |
|||
|
|||
date() |
|||
``` |
|||
|
|||
## [1] "Mon Aug 25 22:27:38 2014" |
|||
|
|||
``` {.r} |
|||
test_dir("tests/") |
|||
``` |
|||
|
|||
## basic functionality : |
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 32 KiB |
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 30 KiB |
After Width: | Height: | Size: 30 KiB |
@ -0,0 +1,25 @@ |
|||
% Generated by roxygen2 (4.0.1.99): do not edit by hand |
|||
\docType{data} |
|||
\name{state_coords} |
|||
\alias{state_coords} |
|||
\title{state_coords} |
|||
\format{A data frame with 51 rows and 4 variables} |
|||
\description{ |
|||
simple coordinates for states to use in a 'statebin' plot |
|||
\itemize{ |
|||
\item \code{abbrev}. state abbreviation, including \code{DC} (chr) |
|||
\item \code{state}. capitalized state name (chr) |
|||
\item \code{col}. colum where it fits (12x8 grid) (chr) |
|||
\item \code{row}. row where it fits (12x8 grid) (chr) |
|||
} |
|||
} |
|||
\note{ |
|||
Last updated 2014-08-25 |
|||
} |
|||
\seealso{ |
|||
\itemize{ |
|||
\item WaPo - \url{http://www.washingtonpost.com/wp-srv/special/business/states-most-threatened-by-trade/} |
|||
} |
|||
} |
|||
\keyword{datasets} |
|||
|
Loading…
Reference in new issue