Skip to content

Commit

Permalink
news entry
Browse files Browse the repository at this point in the history
  • Loading branch information
kylebaron committed Sep 22, 2023
1 parent d5cfec7 commit efda24d
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ BugReports: https://github.com/metrumresearchgroup/lastdose/issues
Suggests: testthat, withr
Encoding: UTF-8
LazyData: true
RoxygenNote: 7.1.2
RoxygenNote: 7.2.3
Roxygen: list(markdown = TRUE)
Language: en-US
5 changes: 5 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# lastdose (development version)

## Bugs Fixed

- Fixed bug where `amt` was getting modified in source data frame
when it contained missing values (#40, #41).

# lastdose 0.4.1

- Fix bug where comments vector wasn't getting adjusted when `TIME` contained
Expand Down
18 changes: 18 additions & 0 deletions tests/testthat/test-lastdose.R
Original file line number Diff line number Diff line change
Expand Up @@ -359,3 +359,21 @@ test_that("comments vector is subset for NA time #38 [LSD-TEST-025]", {
data <- lastdose(data)
expect_equal(data$TAD, c(-1, 0, NA, -1, 0, 0.25))
})

test_that("data frame is not modified", {
data <- data.frame(
ID = 1,
AMT = c(0, 1, NA, 0, 0),
TIME = c(1, 2, 3, 4, 5),
EVID = c(0, 1, 0, 0, 0)
)
data2 <- data.frame(
ID = 1,
AMT = c(0, 1, NA, 0, 0),
TIME = c(1, 2, 3, 4, 5),
EVID = c(0, 1, 0, 0, 0)
)
expect_identical(data, data2)
ld <- lastdose(data)
expect_identical(data, data2)
})

0 comments on commit efda24d

Please sign in to comment.