Displaying 2 results from an estimated 2 matches for "partial2".
Did you mean:
partial
2012 Sep 06
2
choose() function returning anomalous results (zero instead of one)
...Script
# Copyright 2012 Shayne Hodge
# Two-vendor Sensitivity Analysis
rm(list=ls()) # Clear previous session data
library("R.basic")
ptm <- proc.time()
ugly_function <- function(nn,k,Qone,Qtwo,f11,f12,f21,f22)
{
partial1 <- (((1-f11)*(1-f12))^(Qone-nn))*((f11+(1-f11)*f12)^nn)
partial2 <- (((1-f21)*(1-f22))^(Qtwo-k))* ((f21+(1-f21)*f22)^(k))
#ifelse ( ((Qone < 125)|((Qone-nn)<75)|(nn<75)), test1 <-
nChooseK(Qone,nn), test1 <- choose(Qone,nn))
#ifelse ( ((Qtwo < 125)|((Qtwo-k)<75)|(k<75)), test2 <- nChooseK(Qtwo,k),
test2 <- choose(Qtwo,k))
test1 &...
2007 Feb 12
1
bug in partial matching of attribute names
..., "abcd") <- 101
> attr(x, "ab") # incorrectly returns non-NULL for ambig partial match
[1] 101
> names(attributes(x))
[1] "names" "abcdef" "abc" "abcd"
>
The problem in do_attr() looks to be that after match is set to
PARTIAL2, it can be set back to PARTIAL again. I think a simple fix is
to add a "break" in this block in do_attr():
else if (match == PARTIAL) {
/* this match is partial and we already have a partial match,
so the query is ambiguous and we return R_NilValue */
match = PARTIAL2;
brea...