diff --git a/DESCRIPTION b/DESCRIPTION index 11ce7d2..5c1733e 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -17,12 +17,14 @@ Imports: magrittr, osqp, purrr, + tidyr, quadprog, reshape2, 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)