Giter Club home page Giter Club logo

Comments (10)

vpnagraj avatar vpnagraj commented on June 27, 2024 1

epicontacts 1.0.1 now on CRAN:
https://cran.r-project.org/web/packages/epicontacts/index.html
💯

from epicontacts.

finlaycampbell avatar finlaycampbell commented on June 27, 2024

Just found a small bug that should be fixed before submitting to CRAN!
When providing a linelist with only a single column (id), the linelist is converted to a vector and isn't read into the epicontacts object properly ('NULL cases in linelist').

tmp <- data.frame(id = mers_korea_2015$linelist$id)
x <- make_epicontacts(linelist = tmp, contacts = mers_korea_2015$contacts)
x

/// Epidemiological Contacts //

// class: epicontacts
// NULL cases in linelist; 98 contacts; non directed

// linelist

A tibble: 162 × 1

value

1 SK_1
2 SK_2
3 SK_3
4 SK_4
5 SK_5
6 SK_6
7 SK_7
8 SK_8
9 SK_9
10 SK_10

... with 152 more rows

// contacts

A tibble: 98 × 4

from     to       exposure diff_dt_onset


1 SK_14 SK_113 Emergency room 10
2 SK_14 SK_116 Emergency room 13
3 SK_14 SK_41 Emergency room 14
4 SK_14 SK_112 Emergency room 14
5 SK_14 SK_100 Emergency room 15
6 SK_14 SK_114 Emergency room 15
7 SK_14 SK_136 Emergency room 15
8 SK_14 SK_47 Emergency room 16
9 SK_14 SK_110 Emergency room 16
10 SK_14 SK_122 Emergency room 16

... with 88 more rows

I'll look for a fix now, just posting so we don't submit to CRAN yet!

from epicontacts.

finlaycampbell avatar finlaycampbell commented on June 27, 2024

OK I've pushed a fix now, should be working!

from epicontacts.

vpnagraj avatar vpnagraj commented on June 27, 2024

@thibautjombart @finlaycampbell thanks for the patches will submit to CRAN today

from epicontacts.

thibautjombart avatar thibautjombart commented on June 27, 2024

Thanks @finlaycampbell for spotting and fixing this!

@vpnagraj awesome thanks :)

from epicontacts.

vpnagraj avatar vpnagraj commented on June 27, 2024

@thibautjombart @finlaycampbell so i built and checked (devtools::check() and devtools::build_win()) with no errors earlier today ... i tried submitting the new version to CRAN but it was rejected with the following log:

* using log directory 'd:/RCompile/CRANincoming/R-devel/epicontacts.Rcheck'
* using R Under development (unstable) (2017-05-09 r72665)
* using platform: x86_64-w64-mingw32 (64-bit)
* using session charset: ISO8859-1
* checking for file 'epicontacts/DESCRIPTION' ... OK
* checking extension type ... Package
* this is package 'epicontacts' version '1.0.1'
* checking CRAN incoming feasibility ... Note_to_CRAN_maintainers
Maintainer: 'VP Nagraj <[email protected]>'
* checking package namespace information ... OK
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking if there is a namespace ... OK
* checking for hidden files and directories ... OK
* checking for portable file names ... OK
* checking whether package 'epicontacts' can be installed ... OK
* checking installed package size ... OK
* checking package directory ... OK
* checking 'build' directory ... OK
* checking DESCRIPTION meta-information ... OK
* checking top-level files ... OK
* checking for left-over files ... OK
* checking index information ... OK
* checking package subdirectories ... OK
* checking R files for non-ASCII characters ... OK
* checking R files for syntax errors ... OK
* loading checks for arch 'i386'
** checking whether the package can be loaded ... OK
** checking whether the package can be loaded with stated dependencies ... OK
** checking whether the package can be unloaded cleanly ... OK
** checking whether the namespace can be loaded with stated dependencies ... OK
** checking whether the namespace can be unloaded cleanly ... OK
** checking loading without being on the library search path ... OK
** checking use of S3 registration ... OK
* loading checks for arch 'x64'
** checking whether the package can be loaded ... OK
** checking whether the package can be loaded with stated dependencies ... OK
** checking whether the package can be unloaded cleanly ... OK
** checking whether the namespace can be loaded with stated dependencies ... OK
** checking whether the namespace can be unloaded cleanly ... OK
** checking loading without being on the library search path ... OK
** checking use of S3 registration ... OK
* checking dependencies in R code ... OK
* checking S3 generic/method consistency ... OK
* checking replacement functions ... OK
* checking foreign function calls ... OK
* checking R code for possible problems ... OK
* checking Rd files ... OK
* checking Rd metadata ... OK
* checking Rd line widths ... OK
* checking Rd cross-references ... OK
* checking for missing documentation entries ... OK
* checking for code/documentation mismatches ... OK
* checking Rd \usage sections ... OK
* checking Rd contents ... OK
* checking for unstated dependencies in examples ... OK
* checking installed files from 'inst/doc' ... OK
* checking files in 'vignettes' ... OK
* checking examples ...
** running examples for arch 'i386' ... ERROR
Running examples in 'epicontacts-Ex.R' failed
The error most likely occurred in:

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: as.igraph.epicontacts
> ### Title: Create igraph object from contact data
> ### Aliases: as.igraph.epicontacts
> 
> ### ** Examples
> 
> 
> if (require(outbreaks) && require(igraph)) {
+ ## build data
+ 
+ x <- make_epicontacts(ebola_sim$linelist, ebola_sim$contacts,
+                       id = "case.id", to = "case.id", from ="infector",
+                       directed = TRUE)
+ 
+ 
+ ## subset data - keep 50 cases from linelist with contacts
+ 
+ ids <- get_id(x, "common")[1:50]
+ ids
+ x <- x[ids, ids]
+ 
+ 
+ ## make igraph object with associated attributes from epicontacts object
+ 
+ net <- as.igraph(x)
+ net
+ plot(net, vertex.label = "", vertex.size = 10,
+      vertex.color = cases_pal(50))
+ }
Loading required package: outbreaks
Loading required package: igraph

Attaching package: 'igraph'

The following objects are masked from 'package:stats':

    decompose, spectrum

The following object is masked from 'package:base':

    union

Error in `[.data.frame`(linelist, , id) : undefined columns selected
Calls: make_epicontacts -> [ -> [.data.frame
Execution halted
** running examples for arch 'x64' ... ERROR
Running examples in 'epicontacts-Ex.R' failed
The error most likely occurred in:

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: as.igraph.epicontacts
> ### Title: Create igraph object from contact data
> ### Aliases: as.igraph.epicontacts
> 
> ### ** Examples
> 
> 
> if (require(outbreaks) && require(igraph)) {
+ ## build data
+ 
+ x <- make_epicontacts(ebola_sim$linelist, ebola_sim$contacts,
+                       id = "case.id", to = "case.id", from ="infector",
+                       directed = TRUE)
+ 
+ 
+ ## subset data - keep 50 cases from linelist with contacts
+ 
+ ids <- get_id(x, "common")[1:50]
+ ids
+ x <- x[ids, ids]
+ 
+ 
+ ## make igraph object with associated attributes from epicontacts object
+ 
+ net <- as.igraph(x)
+ net
+ plot(net, vertex.label = "", vertex.size = 10,
+      vertex.color = cases_pal(50))
+ }
Loading required package: outbreaks
Loading required package: igraph

Attaching package: 'igraph'

The following objects are masked from 'package:stats':

    decompose, spectrum

The following object is masked from 'package:base':

    union

Error in `[.data.frame`(linelist, , id) : undefined columns selected
Calls: make_epicontacts -> [ -> [.data.frame
Execution halted
* checking for unstated dependencies in 'tests' ... OK
* checking tests ...
** running tests for arch 'i386' ... [3s] ERROR
  Running 'testthat.R' [1s]
Running the tests in 'tests/testthat.R' failed.
Last 13 lines of output:
  1: make_epicontacts(ebola_sim$linelist, ebola_sim$contacts, id = "case.id", to = "case.id", 
         from = "infector", directed = TRUE) at testthat/test_thin.R:4
  2: linelist[, id]
  3: `[.data.frame`(linelist, , id)
  4: stop("undefined columns selected")
  
  testthat results ================================================================
  OK: 0 SKIPPED: 36 FAILED: 4
  1. Error: Various subsetting using [ (@test_handling.R#4) 
  2. Error: Errors / warnings happen when they should (@test_handling.R#55) 
  3. Error: Reordering of columns works (@test_make_epicontacts.R#85) 
  4. Error: Thin ouputs are correct (@test_thin.R#4) 
  
  Error: testthat unit tests failed
  Execution halted
** running tests for arch 'x64' ... [2s] ERROR
  Running 'testthat.R' [2s]
Running the tests in 'tests/testthat.R' failed.
Last 13 lines of output:
  1: make_epicontacts(ebola_sim$linelist, ebola_sim$contacts, id = "case.id", to = "case.id", 
         from = "infector", directed = TRUE) at testthat/test_thin.R:4
  2: linelist[, id]
  3: `[.data.frame`(linelist, , id)
  4: stop("undefined columns selected")
  
  testthat results ================================================================
  OK: 0 SKIPPED: 36 FAILED: 4
  1. Error: Various subsetting using [ (@test_handling.R#4) 
  2. Error: Errors / warnings happen when they should (@test_handling.R#55) 
  3. Error: Reordering of columns works (@test_make_epicontacts.R#85) 
  4. Error: Thin ouputs are correct (@test_thin.R#4) 
  
  Error: testthat unit tests failed
  Execution halted
* checking for unstated dependencies in vignettes ... OK
* checking package vignettes in 'inst/doc' ... OK
* checking re-building of vignette outputs ... [10s] WARNING
Error in re-building vignettes:
  ...
Warning in structure(x, class = unique(c("AsIs", oldClass(x)))) :
  Calling 'structure(NULL, *)' is deprecated, as NULL cannot have attributes.
  Consider 'structure(list(), *)' instead.
Quitting from lines 219-233 (epicontacts.Rmd) 
Error: processing vignette 'epicontacts.Rmd' failed with diagnostics:
undefined columns selected
Execution halted

* checking PDF version of manual ... OK
* DONE
Status: 4 ERRORs, 1 WARNING

i made a couple of commits to address the ERRORs but noticed now we're getting build fails on appveyor and travis ... i reverted my commits and what's weird is that the same codebase that was building fine earlier is now erroring 😖

i'm really stuck on the issue in the vignette building ...

Warning in structure(x, class = unique(c("AsIs", oldClass(x)))) :
  Calling 'structure(NULL, *)' is deprecated, as NULL cannot have attributes.
  Consider 'structure(list(), *)' instead.

going to keep digging into this but an extra set of eyes is appreciated

from epicontacts.

thibautjombart avatar thibautjombart commented on June 27, 2024

OK, whoever has killed a black cat or broken a mirror should be really ashamed of themselves now ;)
I'll start digging too.

from epicontacts.

thibautjombart avatar thibautjombart commented on June 27, 2024

Should be fixed via bd685c2

from epicontacts.

vpnagraj avatar vpnagraj commented on June 27, 2024

! thanks @thibautjombart will try another release today

from epicontacts.

thibautjombart avatar thibautjombart commented on June 27, 2024

Rockstar! For the record, this was not in vain. epicontacts will be part of the analytics pipeline for the current Ebola outbreak in DRC.

from epicontacts.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.