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

add drop = FALSE to matrices #19

Merged
merged 2 commits into from Jan 23, 2020
Merged

add drop = FALSE to matrices #19

merged 2 commits into from Jan 23, 2020

Conversation

zkamvar
Copy link
Member

@zkamvar zkamvar commented Jan 23, 2020

I've also updated the data so that it will be safe from the R 4.0 change that will treat matrices as class "matrix", "array".

This will fix #18

  i <- incidence::incidence(as.Date('2020-01-23'))
si <- c(0.2, 0.5, 0.2, 0.1)
R0 <- 2

p <- projections::project(x = i,
  si = si,
  R = R0,
  n_sim = 1,  # doesn't work with 1 in project function
  R_fix_within = TRUE,
  n_days = 2, # doing 2 days as project function currently not working with one day - will only use first day though
  model = "poisson"
)
p
#> 
#> /// Incidence projections //
#> 
#>   // class: projections, matrix
#>   // 2 dates (rows); 1 simulations (columns)
#> 
#>  // first rows/columns:
#>            [,1]
#> 2020-01-24    2
#> 2020-01-25    6
#> 
#>  // dates:
#> [1] "2020-01-24" "2020-01-25"

Created on 2020-01-23 by the reprex package (v0.3.0)

I've also updated the data so that it will be safe from the R 4.0 change
that will treat matrices as class "matrix", "array".

This will fix #18
@zkamvar zkamvar requested a review from annecori January 23, 2020 12:39
@codecov
Copy link

codecov bot commented Jan 23, 2020

Codecov Report

Merging #19 into master will increase coverage by 2.17%.
The diff coverage is 87.5%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #19      +/-   ##
==========================================
+ Coverage    92.6%   94.78%   +2.17%     
==========================================
  Files           9        9              
  Lines         230      230              
==========================================
+ Hits          213      218       +5     
+ Misses         17       12       -5
Impacted Files Coverage Δ
R/conversion.R 100% <100%> (ø) ⬆️
R/build_projections.R 100% <100%> (ø) ⬆️
R/project.R 87.01% <86.36%> (+6.49%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7780512...23563be. Read the comment docs.

@zkamvar zkamvar merged commit 6df6d97 into master Jan 23, 2020
@zkamvar zkamvar deleted the znk-fix-18 branch January 24, 2020 09:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

can't simulate for single day or single trajectory
1 participant