Skip to content

Commit

Permalink
Test use_article() and github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
JieYinStat committed Mar 21, 2024
1 parent af22019 commit dee6949
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 0 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@
^docs$
^pkgdown$
^data-raw$
^vignettes/articles$
7 changes: 7 additions & 0 deletions tests/testthat/test-IES.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,10 @@ test_that("IES get the same result with R and RcppArmadillo", {
q <- 16
expect_equal(r_IES_compare(X, n, q), c_IES_compare(X, n, q))
})
test_that("IES R-version works", {
data <- data_numeric_regression
X <- data[-which(names(data) == "y")]
n <- 1000
q <- 16
expect_true(length(r_IES(X, n, q)) == 1000)
})
25 changes: 25 additions & 0 deletions vignettes/articles/IES_Simulation.Rmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
title: "IES_Simulation"
---

```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>"
)
```

```{r setup}
library(dbsubsampling)
library(pbmcapply)
```

I'll write a small snippet of code here to check if it works on the github remote server. Mainly because `mclapply` doesn't run on windows, in addition to testing to see if parallel computation is possible and estimating the runtime.

```{r}
data <- data_IES_Case_1_Train
start_time <- Sys.time()
result <- pbmclapply(1:10000, function(x) lm(y ~. , data = data)[["coefficients"]][1], mc.cores = 5)
print(Sys.time() - start_time)
```

0 comments on commit dee6949

Please sign in to comment.