Closed acoppock closed 2 years ago
I can take a look at this on Monday.
On Thu, Oct 7, 2021, 4:33 PM Alexander Coppock @.***> wrote:
blocks <- structure(c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), label = "0 = texas; 1 = arkansas", format.stata = "%8.0g")
declaration <- declare_ra( N = 66,
bug??
blocks = blocks, block_m = c(15, 18) )
thinks it's complete
declaration
blocks2 <- c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1)
declaration <- declare_ra( N = 66, blocks = blocks2, block_m = c(15, 18) )
gets it right
declaration
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/DeclareDesign/randomizr/issues/92, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADGGTTK7W2AUIUTY4AVYSLUFYU2FANCNFSM5FSMKKIQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
The bad check is at:
?is.vector tells us:
is.vector returns TRUE if x is a vector of the specified mode having no attributes other than names. It returns FALSE otherwise.
So the extra attributes on blocks cause the check to be false.
Perhaps you want to change from is.vector
to !is.null(blocks)
?
Thank you @nfultz, this fixed the problem.