Skip to content

Commit 5938373

Browse files
committed
0.6.2 - fix DataSummary issues
1 parent 6746735 commit 5938373

7 files changed

Lines changed: 26 additions & 19 deletions

File tree

DESCRIPTION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
Package: DataMan
22
Type: Package
33
Title: Data Summary, One-way Interactive Plot and Model Visualisation Analysis
4-
Version: 0.6.1
5-
Date: 2018-6-17
4+
Version: 0.6.2
5+
Date: 2018-7-18
66
Author: Sixiang Hu <sixiang.hu@Gmail.com>
77
Maintainer: Sixiang Hu <Sixiang.Hu@Gmail.Com>
88
Description: DataMan package provides functions for data summary, one-way plot, and model assess functionalities with 2D and 3D interactive visualisation.

NAMESPACE

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ export(resiPlot)
3535
export(rocPlot)
3636
export(tree2data)
3737
export(varComp)
38+
import(data.table)
3839
importFrom(ROCR,performance)
3940
importFrom(ROCR,prediction)
4041
importFrom(Rcpp,evalCpp)
@@ -45,8 +46,6 @@ importFrom(checkmate,testNumeric)
4546
importFrom(data.table,":=")
4647
importFrom(data.table,as.data.table)
4748
importFrom(data.table,data.table)
48-
importFrom(data.table,dcast)
49-
importFrom(data.table,key)
5049
importFrom(data.table,melt)
5150
importFrom(data.table,set)
5251
importFrom(data.table,setDT)
@@ -69,5 +68,6 @@ importFrom(plotly,subplot)
6968
importFrom(randomForest,getTree)
7069
importFrom(stats,chisq.test)
7170
importFrom(stats,na.omit)
71+
importFrom(stats,var)
7272
importFrom(stats,weighted.mean)
7373
useDynLib(DataMan)

NEWS.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
DataMan 0.6.2
2+
-------------------------------------------------------------
3+
BUG FIXES AND MINOR IMPROVEMENTS
4+
* `DataSummary` Fix issue #48: unique value count is not correct when `NA` included.
5+
* `DataSummary` Fix issue #49: mean value is not correct when `NA` included.
6+
17
DataMan 0.6.1
28
-------------------------------------------------------------
39
NEW FEATURES

R/DataSummary.R

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#' DataSummary
22
#'
33
#' @description function gives summary of the dataset.
4-
#' @usage DataSummary(data,missing=list(NA),wt=NULL,entropy=FALSE,
4+
#' @usage DataSummary(data,missing=list(NA,NaN,Inf,-Inf),wt=NULL,entropy=FALSE,
55
#' entropy_method="emp",sparkline=FALSE)
66
#' @param data This could be data frame, a vector, matrix or data.table.
77
#' @param missing list of possible missing values.
@@ -22,15 +22,15 @@
2222
#' @importFrom checkmate testCharacter testNumeric
2323
#' @export DataSummary
2424
#' @examples
25-
#' DataSummary(mtcars,missing=list(NA,".","Unknown",-1))
25+
#' DataSummary(mtcars,missing=list(NA,NaN,Inf,-Inf,".","Unknown",-1))
2626

27-
DataSummary <- function(data,missing=list(NA,NaN,Inf),wt=NULL,entropy=FALSE,entropy_method="emp",sparkline=FALSE){
27+
DataSummary <- function(data,missing=list(NA,NaN,Inf,-Inf),wt=NULL,entropy=FALSE,entropy_method="emp",sparkline=FALSE){
2828
UseMethod("DataSummary",data)
2929
}
3030

3131
#' @export
3232
#' @rdname DataSummary
33-
DataSummary.data.frame <- function(data,missing=list(NA),wt=NULL,
33+
DataSummary.data.frame <- function(data,missing=list(NA,NaN,Inf,-Inf),wt=NULL,
3434
entropy=FALSE,entropy_method="emp",sparkline=FALSE){
3535
setDT(data)
3636
DataSummary.data.table(data,missing,wt,entropy,entropy_method,sparkline)
@@ -39,7 +39,7 @@ DataSummary.data.frame <- function(data,missing=list(NA),wt=NULL,
3939
#' @export
4040
#' @rdname DataSummary
4141
#'
42-
DataSummary.data.table <- function(data,missing=list(NA),wt=NULL,
42+
DataSummary.data.table <- function(data,missing=list(NA,NaN,Inf,-Inf),wt=NULL,
4343
entropy=FALSE,entropy_method="emp",sparkline=FALSE){
4444

4545
if(is.null(wt)) weight <- rep(1,nrow(data))

R/interPlot.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
#' This is really useful when modeller wants to assess the interaction terms.
1515
#' Hence the `z` can be actual response data or model predictions.
1616
#' @author Sixiang Hu
17-
#' @importFrom data.table data.table setkey key := dcast
17+
#' @import data.table
1818
#' @importFrom plotly plot_ly layout add_surface %>%
1919
#' @export interPlot
2020
#' @examples
@@ -72,4 +72,4 @@ interPlot <- function(x,y,z,weight=NULL,exposure=NULL,numGrpx=10,numGrpy=10,
7272
}
7373

7474
#global variable
75-
globalVariables(c("e","w"))
75+
globalVariables(c("e","w","."))

R/resiPlot.r

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,9 @@
2121
#' heterogeneity
2222
#'
2323
#' @author Sixiang Hu
24-
#' @importFrom data.table setkey data.table
24+
#' @import data.table
2525
#' @importFrom plotly plot_ly add_histogram2dcontour add_trace %>% subplot
26+
#' @importFrom stats var
2627
#' @export resiPlot
2728
#' @examples
2829
#' set.seed(1L)
@@ -88,4 +89,4 @@ resiPlot <- function(act,pred,weight=NULL,exposure=NULL,bucket=20){
8889
}
8990

9091
#global variable
91-
globalVariables(c("x","e","w"))
92+
globalVariables(c("x","e","w","."))

man/DataSummary.Rd

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)