-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
85 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.