Skip to content

Commit

Permalink
documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
philipdelff committed Jan 18, 2025
1 parent 3997edf commit 786f2f2
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 21 deletions.
25 changes: 13 additions & 12 deletions R/NMcheckData.R
Original file line number Diff line number Diff line change
Expand Up @@ -219,30 +219,31 @@ NMcheckData <- function(data,file,covs,covs.occ,cols.num,col.id="ID",
ADDL <- NULL
AMT <- NULL
CMT <- NULL
column <- NULL
check <- NULL
checkTimeInc <- NULL
cov <- NULL
## DV <- NULL
EVID <- NULL
ID.jump <- NULL
## ID <- NULL
II <- NULL
isnewID <- NULL
level <- NULL
MDVDV <- NULL
MDV <- NULL
N <- NULL
newID <- NULL
NidByUID <- NULL
Nids <- NULL
Nrep <- NULL
Nrows <- NULL
NUID <- NULL
occ <- NULL
RATE <- NULL
reset <- NULL
ROW <- NULL
SS <- NULL
column <- NULL
check <- NULL
checkTimeInc <- NULL
cov <- NULL
newID <- NULL
isnewID <- NULL
level <- NULL
occ <- NULL
reset <- NULL
variable <- NULL
NUID <- NULL
NidByUID <- NULL
usubjNotUnique <- NULL

### Section end: Dummy variables, only not to get NOTE's in pacakge checks
Expand Down
6 changes: 3 additions & 3 deletions R/compareCols.R
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ compareCols <- function(...,list.data,keep.names=TRUE,test.equal=FALSE,diff.only

res.dims <- dims(list.data=dots)
message("Dimensions:")
print(as.fun(res.dims))
message(print(as.fun(res.dims)))
}

if(nrow(dt.cols)==0&&ndots==1){
Expand All @@ -193,12 +193,12 @@ compareCols <- function(...,list.data,keep.names=TRUE,test.equal=FALSE,diff.only
} else {
if(diff.only){
message("\nColumns that differ:")
print(as.fun(dt.cols))
message(print(as.fun(dt.cols)))
message()
messageWrap(paste0("\nColumns where no differences were found: ",paste(dt.cols.full[nu==1&n==ndots,column],collapse=", "),"."),fun.msg=message)
} else {
message("\nOverview of all columns:")
print(as.fun(dt.cols))
message(print(as.fun(dt.cols)))
}
}
return(invisible(as.fun(dt.cols)))
Expand Down
9 changes: 8 additions & 1 deletion man/NMreadInits.Rd

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

4 changes: 2 additions & 2 deletions man/NMreadSection.Rd

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

6 changes: 3 additions & 3 deletions man/NMwriteData.Rd

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

17 changes: 17 additions & 0 deletions tests/testthat/test_compareCols.R
Original file line number Diff line number Diff line change
Expand Up @@ -120,3 +120,20 @@ test_that("list.data",{
expect_equal(res1,res2)

})

test_that("basic - not quiet",{

fileRef <- "testReference/compareCols_06.rds"

pk <- readRDS(file=system.file("examples/data/xgxr2.rds",package="NMdata"))

pk.reduced <- pk[1:(.N%/%2)]
pk.reduced[,CYCLE:=NULL]
pk.reduced[,AMT:=as.character(AMT)]


suppressMessages(res1 <- compareCols(pk,pk.reduced,quiet=FALSE))

expect_equal_to_reference(res1,fileRef)

})

0 comments on commit 786f2f2

Please sign in to comment.