Skip to content

Conflict with readr v. 2.0.1 #28

@mollyow

Description

@mollyow

With the update to readr version 2.0.1 and later, there seems to be an issue using ri2 after any of the read_delim functions have been called. Specifically, I believe it is because the bit package is called, which has its own ri class. So when the ri class is attempted to be assigned e.g., in conduct_ri_ATE() here, there is a conflict in how to summarize/print.

Example:

library(devtools)

devtools::install_version(  
  "readr",
  version = "2.0.1",
  repos = "http://cran.us.r-project.org"  
)
library(readr)
library(ri2)

df <- read_csv(I("x,y\n1,2\n3,4")) # is not actually used

table_2.2 <-
  data.frame(d = c(1, 0, 0, 0, 0, 0, 1),
             y = c(15, 15, 20, 20, 10, 15, 30))

## Declare randomization procedure
declaration <- declare_ra(N = 7, m = 2)

## Conduct Randomization Inference
out <- conduct_ri(y ~ d,
                  declaration = declaration,
                  assignment = "d",
                  sharp_hypothesis = 0,
                  data = table_2.2)
out

After the read_csv line, I get a message that registered S3 methods are overwritten by 'bit'. And when the out object is called, I get the message

> out
range index (ri) from Error in cat("range index (ri) from", x[[1]], "to", x[[2]], "maxindex",  : 
  argument 2 (type 'list') cannot be handled by 'cat'

If use readr version 1.4.0, I do not get this error. If I save the ri2::summarize.ri() locally, and apply it to out object, output is as expected. So I think the problem is just in printing/summarizing.


platform aarch64-apple-darwin20
arch aarch64
os darwin20
system aarch64, darwin20
status
major 4
minor 1.1
year 2021
month 08
day 10
svn rev 80725
language R
version.string R version 4.1.1 (2021-08-10)
nickname Kick Things

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions