Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tibble dependancy removal #422

Merged
merged 3 commits into from
Dec 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ Imports:
rlang,
SqlRender (>= 1.1.3),
survival,
tibble,
tidyr,
utils
Suggests:
Expand Down Expand Up @@ -77,6 +76,6 @@ Remotes:
ohdsi/IterativeHardThresholding,
ohdsi/ParallelLogger,
ohdsi/ShinyAppBuilder,
ohdsi/ResultModelManager
ohdsi/ResultModelManager,
RoxygenNote: 7.2.3
Encoding: UTF-8
2 changes: 1 addition & 1 deletion R/AndromedaHelperFunctions.R
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
#===========================

# add population to sqllite
population <- tibble::as_tibble(population)
population <- dplyr::as_tibble(population)

Check warning on line 100 in R/AndromedaHelperFunctions.R

View check run for this annotation

Codecov / codecov/patch

R/AndromedaHelperFunctions.R#L100

Added line #L100 was not covered by tests
plpData$covariateData$population <- population %>%
dplyr::select("rowId", "outcomeCount")

Expand Down
6 changes: 3 additions & 3 deletions R/FeatureImportance.R
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ permute <- function(plpDataLocation,cId,population){

# find a new random selection of people and give them the covariate and value
newPlp <- sample(population$rowId,nSamp)
newData <- tibble::as_tibble(cbind(rowId = newPlp,coi[,-1]))
newData <- dplyr::as_tibble(cbind(rowId = newPlp,coi[,-1]))

# swap old covariate data with new
plpData$covariateData$covariates <- plpData$covariateData$covariates %>% dplyr::filter(.data$covariateId != !!cId) %>% dplyr::collect()
Expand All @@ -215,7 +215,7 @@ permute <- function(plpDataLocation,cId,population){

# sample the pop to replace
swapPlp <- sample(population$rowId,nSamp)
haveCidDataSwapped <- tibble::as_tibble(cbind(rowId = swapPlp,haveCidData[,-1]))
haveCidDataSwapped <- dplyr::as_tibble(cbind(rowId = swapPlp,haveCidData[,-1]))

# find the swapped people to switch
connectedCovs <- plpData$covariateData$covariateRef %>%
Expand All @@ -228,7 +228,7 @@ permute <- function(plpDataLocation,cId,population){
dplyr::filter(.data$rowId %in% swapPlp) %>%
dplyr::collect()

swappedForCid <- tibble::as_tibble(cbind(rowId = haveCidData$rowId[1:nrow(plpToSwap)],plpToSwap[,-1]))
swappedForCid <- dplyr::as_tibble(cbind(rowId = haveCidData$rowId[1:nrow(plpToSwap)],plpToSwap[,-1]))


# swap old covariate data with new
Expand Down
2 changes: 1 addition & 1 deletion R/Predict.R
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@

if(!is.null(maxs)){
if('bins'%in%colnames(maxs)){
covariateData$maxes <- tibble::as_tibble(maxs) %>% dplyr::rename(covariateId = "bins") %>%
covariateData$maxes <- dplyr::as_tibble(maxs) %>% dplyr::rename(covariateId = "bins") %>%

Check warning on line 171 in R/Predict.R

View check run for this annotation

Codecov / codecov/patch

R/Predict.R#L171

Added line #L171 was not covered by tests
dplyr::rename(maxValue = "maxs")
} else{
covariateData$maxes <- maxs
Expand Down
Loading