Skip to content

Commit

Permalink
update to version 0.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
nhejazi committed Sep 20, 2016
1 parent 6cc7532 commit 476709d
Show file tree
Hide file tree
Showing 7 changed files with 85 additions and 36 deletions.
42 changes: 21 additions & 21 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
Package: nima
Title: Nima Hejazi's Miscellaneous R Tools
Version: 0.3.5
Authors@R: person("Nima", "Hejazi", email = "nhejazi@berkeley.edu",
role = c("aut", "cre"))
Version: 0.4.0
Authors@R: as.person(c(
"Nima Hejazi <nhejazi@berkeley.edu> [aut, cre]"))
Description: Miscellaneous R functions developed over the course of statistical
research. These include utilities that supplement the existing
idiosyncrasies of R; extend plotting functionality and aesthetics;
provide alternative presentations of matrix decompositions; extend
access to command line tools and system information.
research. These include utilities that supplement the existing idiosyncrasies
of R; extend existing (and provide customized) plotting functionality and
aesthetics; provide alternative presentations of matrix decompositions; extend
access to command line tools and system information.
Depends:
R (>= 3.2.3)
R (>= 3.2.3)
Imports:
plyr,
utils,
stats,
survival,
gridExtra,
assertthat,
ggthemes,
ggplot2,
scales,
grid
plyr,
utils,
stats,
survival,
gridExtra,
assertthat,
ggthemes,
ggplot2,
scales,
grid
Suggests:
devtools,
roxygen2,
testthat
devtools,
roxygen2,
testthat
License: MIT + file LICENSE
URL: https://github.com/nhejazi/nima
LazyData: true
Expand Down
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export(exit)
export(factornum)
export(hweb)
export(lmPlots_gg)
export(miss_ind)
export(nima_theme)
export(objsizes)
export(openfile)
Expand Down
6 changes: 5 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
September 20, 2016:
* Addition of several functions, re-written DESCRIPTION file. Update of package
version to v. 0.4.0. This version update to be released on CRAN.

July 5, 2016:
* Major changes, including addition of unit tests and Travis-CI coverage, added
to the package for v. 0.3.5. This version update not released on CRAN.
to the package for v. 0.3.5. This version update not to be released on CRAN.

March 25, 2016:
* The first public release of this package (v. 0.3.0) is made available on CRAN.
24 changes: 24 additions & 0 deletions R/missing_ind.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#' Add missingness indicators to existing data.frame
#'
#' Add indicator columns to a data.frame showing the pattern of missingness.
#'
#' @param data A numeric vector or array.
#' @param prefix A string used to name the indicator variables..
#'
#' @return An augmented data.frame with indicators for missingness patterns.
#'
#' @export
#'
#' @examples
#' data <- data.frame(cbind(rnorm(10), runif(10)))
#' data[sample(nrow(data), 3), 1] <- NA
#' data[sample(nrow(data), 4), 2] <- NA
#' data <- miss_ind(data)

miss_ind <- function(data, prefix = "miss_") {
indicators = sapply(data, FUN = function(col) as.numeric(is.na(col)))
colnames(indicators) = paste0(prefix, colnames(data))
indicators = indicators[, !colMeans(indicators) %in% c(0, 1)]
out <- cbind(data, indicators)
return(out)
}
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# R/nima

[![Travis-CI Build Status](https://travis-ci.org/nhejazi/nima.svg?branch=master)
[![Travis-CI Build Status](https://travis-ci.org/nhejazi/nima.svg?branch=develop)
](https://travis-ci.org/nhejazi/nima)
[![Coverage
Status](https://coveralls.io/repos/github/nhejazi/nima/badge.svg?branch=devel)
](https://coveralls.io/github/nhejazi/nima?branch=devel)
Status](https://coveralls.io/repos/github/nhejazi/nima/badge.svg?branch=develop)
](https://coveralls.io/github/nhejazi/nima?branch=develop)
[![CRAN](http://r-pkg.org/badges/version/nima)](http://cran.r-project.org/web/checks/check_results_nima.html)
[![MIT license](http://img.shields.io/badge/license-MIT-brightgreen.svg)](http://opensource.org/licenses/MIT)

Expand All @@ -23,7 +23,7 @@ are useful to me.

This package is made public for my own convenience, with no guarantees.

This package is considered to be __perpetually under development__.
This package should be considered as being __perpetually under development__.

---

Expand Down
14 changes: 4 additions & 10 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,16 @@
## Test environments
* local OS X install, R 3.2.4
* local OS X install, R 3.3.1
* win-builder (devel and release)

## R CMD check results
* There were 0 ERRORs.

* There was 1 WARNING:
* There were 0 WARNINGs.

* LaTeX errors when creating PDF version.

This typically indicates Rd problems, but no errors appear in Rdlatex.log

* There was 1 NOTE:

* New submission
* There were 0 NOTEs.

## Downstream dependencies
* Nothing to report.

## Additional Notes
* Re-submission after adding details to DESCRIPTION. No other changes made.
* Updated submission of package, up from version 0.3.0 to 0.4.0
26 changes: 26 additions & 0 deletions man/miss_ind.Rd

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

0 comments on commit 476709d

Please sign in to comment.