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
With the update to
readrversion 2.0.1 and later, there seems to be an issue using ri2 after any of theread_delimfunctions have been called. Specifically, I believe it is because thebitpackage is called, which has its ownriclass. So when thericlass is attempted to be assigned e.g., inconduct_ri_ATE()here, there is a conflict in how to summarize/print.Example:
After the
read_csvline, I get a message that registered S3 methods are overwritten by 'bit'. And when theoutobject is called, I get the messageIf use
readrversion 1.4.0, I do not get this error. If I save theri2::summarize.ri()locally, and apply it tooutobject, 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