Skip to content

Commit

Permalink
fix for #50, also fix current CRAN errors, bump to v1.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
jhelvy committed Sep 27, 2023
1 parent b18d9a6 commit fc17f42
Show file tree
Hide file tree
Showing 7 changed files with 338 additions and 329 deletions.
5 changes: 3 additions & 2 deletions CRAN-SUBMISSION
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
Version: 1.1.1
Date: 2023-09-24 18:50:26 UTC
SHA: 92fef03dfe3c81e152eac1387dd1426cb87e3a85
Date: 2023-09-27 15:04:38 UTC
SHA:
b18d9a6eb951df2e33ecc79370948817cf4993e8
3 changes: 1 addition & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# logitr 1.1.1

- Updated the `convergence.Rmd` vignette to not run any actual code using other packages to fix issue on CRAN where not all packages are available on all platforms. Now the results are hard-coded in place.
- Fixed bug in `makeObsID()` where `table()` was sorting the results stored in `reps`, which has to be manually undone. Fixes #50.

# logitr 1.1.0

Expand Down Expand Up @@ -310,8 +311,6 @@ bestModel for the WTP calculations, but not the logLik value. Now it's
getting the right logLik value too.
- Fixed a bug with the scaling option where it was blowing up to use scaling numbers.



# logitr 0.0.1

Full reboot of logitr!
Expand Down
11 changes: 11 additions & 0 deletions R/modelInputs.R
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,17 @@ makeObsID <- function(data, inputs, outcome) {
obsID <- as.vector(as.matrix(data[inputs$obsID]))
# Make sure obsID is in sequential order with no repeated IDs
reps <- table(obsID)
# table sorts outcome with no way of not sorting, so have to reorder it 🤦
# see this SO post:
# https://stackoverflow.com/questions/24842157/is-there-a-way-stop-table-from-sorting-in-r
idOrder <- as.character(unique(obsID))
repsOrder <- names(reps)
finalOrder <- rep(NA, length(idOrder))
for (i in 1:length(finalOrder)) {
finalOrder[i] <- which(repsOrder == idOrder[i])
}
reps <- reps[finalOrder]
# Now check if there are repeat errors
checkRepeatedIDs('obsID', obsID, reps)
# Make sure that each observation ID has only one outcome
outcomeCheck <- tapply(outcome, obsID, function(x) sum(x))
Expand Down
Loading

0 comments on commit fc17f42

Please sign in to comment.