From 29ed4e09033b01ee703f3fe25a7aded429c42615 Mon Sep 17 00:00:00 2001 From: Mikkel Vembye Date: Wed, 11 Feb 2026 21:31:26 +0100 Subject: [PATCH 1/2] Overcoming all warning message when using test_sharp_null() --- DESCRIPTION | 3 ++- R/partial_density_plot.R | 2 +- R/test_sharp_null.R | 2 +- R/test_sharp_null_arp.R | 2 +- R/test_sharp_null_arp_binary_m.R | 2 +- R/test_sharp_null_binary_m.R | 2 +- R/test_sharp_null_coxandshi_binary_m.R | 2 +- R/test_sharp_null_fsst_binary_m.R | 2 +- 8 files changed, 9 insertions(+), 8 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 11ce7d2..6c2c37e 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -22,7 +22,8 @@ Imports: Rglpk, sandwich Remotes: - asheshrambachan/HonestDiD + asheshrambachan/HonestDiD, + conroylau/lpinfer RoxygenNote: 7.3.2 Suggests: gurobi, diff --git a/R/partial_density_plot.R b/R/partial_density_plot.R index 46819c2..c8d1515 100644 --- a/R/partial_density_plot.R +++ b/R/partial_density_plot.R @@ -237,7 +237,7 @@ compute_partial_densities_and_shares <- function(df, yvalues <- sort(unique(yvec)) mvalues <- unique(mvec) - my_values <- purrr::cross_df(list(m = mvalues, y = yvalues)) %>% + my_values <- tidyr::expand_grid(m = mvalues, y = yvalues) %>% dplyr::arrange(m, y) %>% dplyr::select(y, m) my_values$m <- as.numeric(as.character(my_values$m)) diff --git a/R/test_sharp_null.R b/R/test_sharp_null.R index 5f9747b..7c8db23 100644 --- a/R/test_sharp_null.R +++ b/R/test_sharp_null.R @@ -204,7 +204,7 @@ devtools::install_github('conroylau/lpinfer')") #Note we need to do this here so that the yvalues remain constant across boostrap draws yvalues <- unique(yvec) mvalues <- unique(mvec) - my_values <- purrr::cross_df(list(m=mvalues,y=yvalues)) %>% + my_values <- tidyr::expand_grid(m=mvalues,y=yvalues) %>% dplyr::arrange(m,y) %>% dplyr::select(y,m) diff --git a/R/test_sharp_null_arp.R b/R/test_sharp_null_arp.R index d730a63..81f7677 100644 --- a/R/test_sharp_null_arp.R +++ b/R/test_sharp_null_arp.R @@ -156,7 +156,7 @@ df[[y]] <- yvec yvalues <- unique(yvec) mvalues <- unique(mvec) - my_values <- purrr::cross_df(list(m=mvalues,y=yvalues)) %>% + my_values <- tidyr::expand_grid(m=mvalues,y=yvalues) %>% dplyr::arrange(m,y) %>% dplyr::select(y,m) diff --git a/R/test_sharp_null_arp_binary_m.R b/R/test_sharp_null_arp_binary_m.R index 282897b..1257e39 100644 --- a/R/test_sharp_null_arp_binary_m.R +++ b/R/test_sharp_null_arp_binary_m.R @@ -55,7 +55,7 @@ test_sharp_null_arp_binary_m <- function(df, yvalues <- sort(unique(yvec)) mvalues <- unique(mvec) - my_values <- purrr::cross_df(list(m=mvalues,y=yvalues)) %>% + my_values <- tidyr::expand_grid(m=mvalues,y=yvalues) %>% dplyr::arrange(m,y) %>% dplyr::select(y,m) diff --git a/R/test_sharp_null_binary_m.R b/R/test_sharp_null_binary_m.R index 4fca829..d27f5a7 100644 --- a/R/test_sharp_null_binary_m.R +++ b/R/test_sharp_null_binary_m.R @@ -78,7 +78,7 @@ test_sharp_null_binary_m <- function(df, yvalues <- sort(unique(yvec)) mvalues <- unique(mvec) - my_values <- purrr::cross_df(list(m=mvalues,y=yvalues)) %>% + my_values <- tidyr::expand_grid(m=mvalues,y=yvalues) %>% dplyr::arrange(m,y) %>% dplyr::select(y,m) diff --git a/R/test_sharp_null_coxandshi_binary_m.R b/R/test_sharp_null_coxandshi_binary_m.R index 61798ee..532ad0e 100644 --- a/R/test_sharp_null_coxandshi_binary_m.R +++ b/R/test_sharp_null_coxandshi_binary_m.R @@ -60,7 +60,7 @@ test_sharp_null_coxandshi_binary_m <- function(df, yvalues <- sort(unique(yvec)) mvalues <- unique(mvec) - my_values <- purrr::cross_df(list(m=mvalues,y=yvalues)) %>% + my_values <- tidyr::expand_grid(m=mvalues,y=yvalues) %>% dplyr::arrange(m,y) %>% dplyr::select(y,m) diff --git a/R/test_sharp_null_fsst_binary_m.R b/R/test_sharp_null_fsst_binary_m.R index 95d1355..bf78f14 100644 --- a/R/test_sharp_null_fsst_binary_m.R +++ b/R/test_sharp_null_fsst_binary_m.R @@ -57,7 +57,7 @@ test_sharp_null_fsst_binary_m <- function(df, yvalues <- sort(unique(yvec)) mvalues <- unique(mvec) - my_values <- purrr::cross_df(list(m=mvalues,y=yvalues)) %>% + my_values <- tidyr::expand_grid(m=mvalues,y=yvalues) %>% dplyr::arrange(m,y) %>% dplyr::select(y,m) From 82cb43f9a8c51ffbe577412aa9246527bcf79c4a Mon Sep 17 00:00:00 2001 From: Mikkel Vembye Date: Wed, 11 Feb 2026 21:50:06 +0100 Subject: [PATCH 2/2] Adding tidyr to Imports --- DESCRIPTION | 1 + 1 file changed, 1 insertion(+) diff --git a/DESCRIPTION b/DESCRIPTION index 6c2c37e..5c1733e 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -17,6 +17,7 @@ Imports: magrittr, osqp, purrr, + tidyr, quadprog, reshape2, Rglpk,