Skip to content
This repository has been archived by the owner on Aug 23, 2022. It is now read-only.

Commit

Permalink
fixing the bugs in data.table 1.9.7
Browse files Browse the repository at this point in the history
  • Loading branch information
sinanshi committed Jun 30, 2016
1 parent baf3b7e commit 1cc6ada
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
6 changes: 2 additions & 4 deletions R/ccTable.R
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,8 @@ ccTable$methods(

ccTable$methods(
update.episode = function(){
sep <- .self$.epindex["index"==TRUE]
.self$tclean <- merge(.self$tclean, sep)
sep <- .self$.epindex[index==TRUE]
.self$tclean <- merge(.self$tclean, sep, by=c("site", "episode_id"))
.self$tclean[["index"]] <- NULL
})

Expand All @@ -149,11 +149,9 @@ ccTable$methods(
cat(paste(item, filter, "\n"))
stop(e)
}

}
)
}

.self$update.entry()
.self$update.episode()
})
Expand Down
12 changes: 6 additions & 6 deletions R/missingness.filter.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ missingness_count <- function(tb) {
length(which(vec!="NA"))/length(vec) * 100
}
items <- names(tb)[!names(tb) %in% c("site", "time", "episode_id")]
flags <- tb[, cmplt(.SD[[items[1]]]), .(episode_id, site)]
setnames(flags, c('episode_id', 'site', items[1]))
flags <- tb[, cmplt(.SD[[items[1]]]), .(site, episode_id)]
setnames(flags, c('site', 'episode_id', items[1]))
flags
}

Expand All @@ -16,13 +16,13 @@ ccTable$methods(
cmplt <- function(vec) {
length(which(vec!="NA"))/length(vec) * 100
}
items_ <- names(tb_)[!names(tb_) %in% c("site", "time", "episode_id")]
flags <- tb_[, cmplt(.SD[[items_[1]]]), .(episode_id, site)]
setnames(flags, c('episode_id', 'site', items_[1]))
items_ <- names(tb_)[!names(tb_) %in% c("site", "episode_id", "time")]
flags <- tb_[, cmplt(.SD[[items_[1]]]), .(site, episode_id)]
setnames(flags, c('site', 'episode_id', items_[1]))
flags
}

.self$dquality[['missingness']] <- .self$torigin[, 1, by=c("episode_id", "site")]
.self$dquality[['missingness']] <- .self$torigin[, 1, by=c("site", "episode_id")]
.self$dquality[['missingness']][, V1:=NULL]
setkey(.self$dquality[['missingness']], site, episode_id)

Expand Down

0 comments on commit 1cc6ada

Please sign in to comment.