diff --git a/docs/articles/DebugFnW.html b/docs/articles/DebugFnW.html index 92bad285..67067a91 100644 --- a/docs/articles/DebugFnW.html +++ b/docs/articles/DebugFnW.html @@ -167,7 +167,7 @@

2019-01-26

## List of 4
 ##  $ fn       :function (i)  
 ##   ..- attr(*, "srcref")= 'srcref' int [1:8] 5 6 5 32 6 32 5 5
-##   .. ..- attr(*, "srcfile")=Classes 'srcfilecopy', 'srcfile' <environment: 0x7f8b68587e58> 
+##   .. ..- attr(*, "srcfile")=Classes 'srcfilecopy', 'srcfile' <environment: 0x7f9ec71f0858> 
 ##  $ args     :List of 1
 ##   ..$ : num 0
 ##  $ namedargs: language df(x)
diff --git a/docs/articles/bquote.html b/docs/articles/bquote.html
index 382e5eae..d143f35f 100644
--- a/docs/articles/bquote.html
+++ b/docs/articles/bquote.html
@@ -173,7 +173,7 @@ 

## envir = where, ## enclos = where) ## } -## <bytecode: 0x7fe0b56e2a38> +## <bytecode: 0x7fdeb6f34cf8> ## <environment: namespace:wrapr>

All evalb() does is: call bquote() as intended. A way to teach this is to just call bqoute() alone.

bquote(
diff --git a/docs/news/index.html b/docs/news/index.html
index f005092c..870a14d6 100644
--- a/docs/news/index.html
+++ b/docs/news/index.html
@@ -153,7 +153,7 @@ 

  • Add string strsplit_capture() and dotsubs().
  • better bquote_function() and evalb() examples.
  • -
  • Allow comparisions in mk_formula().
  • +
  • Allow comparisions in mk_formula(), and general improvements.

diff --git a/docs/reference/DebugFn.html b/docs/reference/DebugFn.html index 7e8aa96f..09186293 100644 --- a/docs/reference/DebugFn.html +++ b/docs/reference/DebugFn.html @@ -195,14 +195,14 @@

Examp # capture error on incorrect run tryCatch( DebugFn(saveDest, f, 12), - error = function(e) { print(e) })

#> <simpleError in value[[3L]](cond): wrapr::DebugFn: wrote '/var/folders/7q/h_jp2vj131g5799gfnpzhdp80000gn/T//RtmpYOcMGY/debug55cf30794a4e.RDS' on catching 'Error in (1:10)[[i]]: subscript out of bounds' + error = function(e) { print(e) })
#> <simpleError in value[[3L]](cond): wrapr::DebugFn: wrote '/var/folders/7q/h_jp2vj131g5799gfnpzhdp80000gn/T//Rtmp9zIcCB/debug79cb6db08614.RDS' on catching 'Error in (1:10)[[i]]: subscript out of bounds' #> You can reproduce the error with: -#> 'p <- readRDS('/var/folders/7q/h_jp2vj131g5799gfnpzhdp80000gn/T//RtmpYOcMGY/debug55cf30794a4e.RDS'); do.call(p$fn, p$args)'>
# examine details +#> 'p <- readRDS('/var/folders/7q/h_jp2vj131g5799gfnpzhdp80000gn/T//Rtmp9zIcCB/debug79cb6db08614.RDS'); do.call(p$fn, p$args)'>
# examine details situation <- readRDS(saveDest) str(situation)
#> List of 3 #> $ fn :function (i) #> ..- attr(*, "srcref")= 'srcref' int [1:8] 3 6 3 32 6 32 3 3 -#> .. ..- attr(*, "srcfile")=Classes 'srcfilecopy', 'srcfile' <environment: 0x7f9bffd03978> +#> .. ..- attr(*, "srcfile")=Classes 'srcfilecopy', 'srcfile' <environment: 0x7fae4f9c8500> #> $ args :List of 1 #> ..$ : num 12 #> $ fn_name: chr "f"
# fix and re-run diff --git a/docs/reference/DebugFnE.html b/docs/reference/DebugFnE.html index ad2bbee9..b8b3bab0 100644 --- a/docs/reference/DebugFnE.html +++ b/docs/reference/DebugFnE.html @@ -195,17 +195,17 @@

Examp # capture error on incorrect run tryCatch( DebugFnE(saveDest, f, 12), - error = function(e) { print(e) })

#> <simpleError in value[[3L]](cond): wrapr::DebugFnE: wrote '/var/folders/7q/h_jp2vj131g5799gfnpzhdp80000gn/T//RtmpYOcMGY/debug55cf5c76c102.RDS' on catching 'Error in (1:10)[[i]]: subscript out of bounds' + error = function(e) { print(e) })
#> <simpleError in value[[3L]](cond): wrapr::DebugFnE: wrote '/var/folders/7q/h_jp2vj131g5799gfnpzhdp80000gn/T//Rtmp9zIcCB/debug79cb17c0c438.RDS' on catching 'Error in (1:10)[[i]]: subscript out of bounds' #> You can reproduce the error with: -#> 'p <- readRDS('/var/folders/7q/h_jp2vj131g5799gfnpzhdp80000gn/T//RtmpYOcMGY/debug55cf5c76c102.RDS'); do.call(p$fn, p$args, envir= p$env)'>
# examine details +#> 'p <- readRDS('/var/folders/7q/h_jp2vj131g5799gfnpzhdp80000gn/T//Rtmp9zIcCB/debug79cb17c0c438.RDS'); do.call(p$fn, p$args, envir= p$env)'>
# examine details situation <- readRDS(saveDest) str(situation)
#> List of 4 #> $ fn :function (i) #> ..- attr(*, "srcref")= 'srcref' int [1:8] 3 6 3 32 6 32 3 3 -#> .. ..- attr(*, "srcfile")=Classes 'srcfilecopy', 'srcfile' <environment: 0x7f9c001534c0> +#> .. ..- attr(*, "srcfile")=Classes 'srcfilecopy', 'srcfile' <environment: 0x7fae4ea9c0d8> #> $ args :List of 1 #> ..$ : num 12 -#> $ env :<environment: 0x7f9c00153840> +#> $ env :<environment: 0x7fae4ea9c458> #> $ fn_name: chr "f"
# fix and re-run situation$args[[1]] <- 6 do.call(situation$fn, situation$args, envir=situation$env)
#> [1] 6
# clean up diff --git a/docs/reference/DebugFnW.html b/docs/reference/DebugFnW.html index 2d749742..51742ee0 100644 --- a/docs/reference/DebugFnW.html +++ b/docs/reference/DebugFnW.html @@ -192,14 +192,14 @@

Examp # capture error on incorrect run tryCatch( df(12), - error = function(e) { print(e) })

#> <simpleError in value[[3L]](cond): wrapr::DebugFnW: wrote '/var/folders/7q/h_jp2vj131g5799gfnpzhdp80000gn/T//RtmpYOcMGY/debug55cf2eb7193.RDS' on catching 'Error in (1:10)[[i]]: subscript out of bounds' + error = function(e) { print(e) })
#> <simpleError in value[[3L]](cond): wrapr::DebugFnW: wrote '/var/folders/7q/h_jp2vj131g5799gfnpzhdp80000gn/T//Rtmp9zIcCB/debug79cb57874e86.RDS' on catching 'Error in (1:10)[[i]]: subscript out of bounds' #> You can reproduce the error with: -#> 'p <- readRDS('/var/folders/7q/h_jp2vj131g5799gfnpzhdp80000gn/T//RtmpYOcMGY/debug55cf2eb7193.RDS'); do.call(p$fn, p$args)'>
# examine details +#> 'p <- readRDS('/var/folders/7q/h_jp2vj131g5799gfnpzhdp80000gn/T//Rtmp9zIcCB/debug79cb57874e86.RDS'); do.call(p$fn, p$args)'>
# examine details situation <- readRDS(saveDest) str(situation)
#> List of 4 #> $ fn :function (i) #> ..- attr(*, "srcref")= 'srcref' int [1:8] 3 6 3 32 6 32 3 3 -#> .. ..- attr(*, "srcfile")=Classes 'srcfilecopy', 'srcfile' <environment: 0x7f9bfd8db3f0> +#> .. ..- attr(*, "srcfile")=Classes 'srcfilecopy', 'srcfile' <environment: 0x7fae4caf9808> #> $ args :List of 1 #> ..$ : num 12 #> $ namedargs: language df(12) @@ -222,7 +222,7 @@

Examp #> 'do.call(p$fn, p$args)' (replace 'p' with actual variable name)>

str(lastError)
#> List of 4 #> $ fn :function (i) #> ..- attr(*, "srcref")= 'srcref' int [1:8] 22 6 22 32 6 32 22 22 -#> .. ..- attr(*, "srcfile")=Classes 'srcfilecopy', 'srcfile' <environment: 0x7f9bff0c4070> +#> .. ..- attr(*, "srcfile")=Classes 'srcfilecopy', 'srcfile' <environment: 0x7fae4f14c5c8> #> $ args :List of 1 #> ..$ : num 12 #> $ namedargs: language df(12) diff --git a/docs/reference/DebugFnWE.html b/docs/reference/DebugFnWE.html index 48648b52..04e206c9 100644 --- a/docs/reference/DebugFnWE.html +++ b/docs/reference/DebugFnWE.html @@ -197,19 +197,19 @@

Examp # capture error on incorrect run tryCatch( df(12), - error = function(e) { print(e) })

#> <simpleError in value[[3L]](cond): wrapr::DebugFnWE: wrote '/var/folders/7q/h_jp2vj131g5799gfnpzhdp80000gn/T//RtmpYOcMGY/debug55cf1470f84d.RDS' on catching 'Error in (1:10)[[i]]: subscript out of bounds' + error = function(e) { print(e) })
#> <simpleError in value[[3L]](cond): wrapr::DebugFnWE: wrote '/var/folders/7q/h_jp2vj131g5799gfnpzhdp80000gn/T//Rtmp9zIcCB/debug79cb7a1f8b0b.RDS' on catching 'Error in (1:10)[[i]]: subscript out of bounds' #> You can reproduce the error with: -#> 'p <- readRDS('/var/folders/7q/h_jp2vj131g5799gfnpzhdp80000gn/T//RtmpYOcMGY/debug55cf1470f84d.RDS'); do.call(p$fn, p$args, envir= p$env)'>
# examine details +#> 'p <- readRDS('/var/folders/7q/h_jp2vj131g5799gfnpzhdp80000gn/T//Rtmp9zIcCB/debug79cb7a1f8b0b.RDS'); do.call(p$fn, p$args, envir= p$env)'>
# examine details situation <- readRDS(saveDest) str(situation)
#> List of 5 #> $ fn :function (i) #> ..- attr(*, "srcref")= 'srcref' int [1:8] 3 6 3 32 6 32 3 3 -#> .. ..- attr(*, "srcfile")=Classes 'srcfilecopy', 'srcfile' <environment: 0x7f9bffaa9cd8> +#> .. ..- attr(*, "srcfile")=Classes 'srcfilecopy', 'srcfile' <environment: 0x7fae4fe8fe88> #> $ args :List of 1 #> ..$ : num 12 #> $ namedargs: language df(12) #> $ fn_name : chr "f" -#> $ env :<environment: 0x7f9bffaaa058>
# fix and re-run +#> $ env :<environment: 0x7fae4fe90208>
# fix and re-run situation$args[[1]] <- 6 do.call(situation$fn, situation$args, envir=situation$env)
#> [1] 6
# clean up file.remove(saveDest)
#> [1] TRUE
diff --git a/docs/reference/DebugPrintFn.html b/docs/reference/DebugPrintFn.html index 62e96333..aa3a0723 100644 --- a/docs/reference/DebugPrintFn.html +++ b/docs/reference/DebugPrintFn.html @@ -197,14 +197,14 @@

Examp # capture error on incorrect run tryCatch( DebugPrintFn(saveDest, f, 12), - error = function(e) { print(e) })

#> <simpleError in value[[3L]](cond): wrapr::DebugPrintFn: wrote '/var/folders/7q/h_jp2vj131g5799gfnpzhdp80000gn/T//RtmpYOcMGY/debug55cf287e1690.RDS' on catching 'Error in (1:10)[[i]]: subscript out of bounds' + error = function(e) { print(e) })
#> <simpleError in value[[3L]](cond): wrapr::DebugPrintFn: wrote '/var/folders/7q/h_jp2vj131g5799gfnpzhdp80000gn/T//Rtmp9zIcCB/debug79cb5a94a99c.RDS' on catching 'Error in (1:10)[[i]]: subscript out of bounds' #> You can reproduce the error with: -#> 'p <- readRDS('/var/folders/7q/h_jp2vj131g5799gfnpzhdp80000gn/T//RtmpYOcMGY/debug55cf287e1690.RDS'); do.call(p$fn, p$args)'>
# examine details +#> 'p <- readRDS('/var/folders/7q/h_jp2vj131g5799gfnpzhdp80000gn/T//Rtmp9zIcCB/debug79cb5a94a99c.RDS'); do.call(p$fn, p$args)'>
# examine details situation <- readRDS(saveDest) str(situation)
#> List of 3 #> $ fn :function (i) #> ..- attr(*, "srcref")= 'srcref' int [1:8] 3 6 3 32 6 32 3 3 -#> .. ..- attr(*, "srcfile")=Classes 'srcfilecopy', 'srcfile' <environment: 0x7f9bf8cb6b78> +#> .. ..- attr(*, "srcfile")=Classes 'srcfilecopy', 'srcfile' <environment: 0x7fae4a8ee980> #> $ args :List of 1 #> ..$ : num 12 #> $ fn_name: chr "f"
# fix and re-run diff --git a/docs/reference/DebugPrintFnE.html b/docs/reference/DebugPrintFnE.html index fae06fb7..5db3a14c 100644 --- a/docs/reference/DebugPrintFnE.html +++ b/docs/reference/DebugPrintFnE.html @@ -197,17 +197,17 @@

Examp # capture error on incorrect run tryCatch( DebugPrintFnE(saveDest, f, 12), - error = function(e) { print(e) })

#> <simpleError in value[[3L]](cond): wrapr::DebugPrintFnE: wrote '/var/folders/7q/h_jp2vj131g5799gfnpzhdp80000gn/T//RtmpYOcMGY/debug55cf594b1b6e.RDS' on catching 'Error in (1:10)[[i]]: subscript out of bounds' + error = function(e) { print(e) })
#> <simpleError in value[[3L]](cond): wrapr::DebugPrintFnE: wrote '/var/folders/7q/h_jp2vj131g5799gfnpzhdp80000gn/T//Rtmp9zIcCB/debug79cb5bdace18.RDS' on catching 'Error in (1:10)[[i]]: subscript out of bounds' #> You can reproduce the error with: -#> 'p <- readRDS('/var/folders/7q/h_jp2vj131g5799gfnpzhdp80000gn/T//RtmpYOcMGY/debug55cf594b1b6e.RDS'); do.call(p$fn, p$args, envir= p$env)'>
# examine details +#> 'p <- readRDS('/var/folders/7q/h_jp2vj131g5799gfnpzhdp80000gn/T//Rtmp9zIcCB/debug79cb5bdace18.RDS'); do.call(p$fn, p$args, envir= p$env)'>
# examine details situation <- readRDS(saveDest) str(situation)
#> List of 4 #> $ fn :function (i) #> ..- attr(*, "srcref")= 'srcref' int [1:8] 3 6 3 32 6 32 3 3 -#> .. ..- attr(*, "srcfile")=Classes 'srcfilecopy', 'srcfile' <environment: 0x7f9c002dde28> +#> .. ..- attr(*, "srcfile")=Classes 'srcfilecopy', 'srcfile' <environment: 0x7fae4d124a18> #> $ args :List of 1 #> ..$ : num 12 -#> $ env :<environment: 0x7f9c002de1a8> +#> $ env :<environment: 0x7fae4d124d98> #> $ fn_name: chr "f"
# fix and re-run situation$args[[1]] <- 6 do.call(situation$fn, situation$args, envir=situation$env)
#> [1] 6
# clean up diff --git a/docs/reference/buildNameCallback.html b/docs/reference/buildNameCallback.html index e22109c4..f91150da 100644 --- a/docs/reference/buildNameCallback.html +++ b/docs/reference/buildNameCallback.html @@ -189,7 +189,7 @@

Examp str(lastError)

#> List of 4 #> $ fn :function (i) #> ..- attr(*, "srcref")= 'srcref' int [1:8] 3 6 3 32 6 32 3 3 -#> .. ..- attr(*, "srcfile")=Classes 'srcfilecopy', 'srcfile' <environment: 0x7f9bff076f40> +#> .. ..- attr(*, "srcfile")=Classes 'srcfilecopy', 'srcfile' <environment: 0x7fae4f0f3f50> #> $ args :List of 1 #> ..$ : num 12 #> $ namedargs: language df(12) diff --git a/docs/reference/mk_formula.html b/docs/reference/mk_formula.html index c7bc5d27..390f35a7 100644 --- a/docs/reference/mk_formula.html +++ b/docs/reference/mk_formula.html @@ -32,7 +32,7 @@ - @@ -153,7 +153,7 @@

Construct a formula.

-

Safely construct a formula from the outcome (dependent variable) name +

Safely construct a simple Wilkinson notation formula from the outcome (dependent variable) name and vector of input (independent variable) names.

@@ -226,18 +226,18 @@

Examp #> (Intercept) cyl disp #> 34.66099 -1.58728 -0.02058 #>

format(model$terms)
#> [1] "mpg ~ cyl + disp"
-f <- mk_formula("cyl", c("hp", "disp"), outcome_target = 8, outcome_comparator = ">=") -print(f)
#> (cyl >= 8) ~ hp + disp -#> <environment: base>
(model <- glm(f, mtcars, family = binomial))
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> +f <- mk_formula("cyl", c("wt", "gear"), outcome_target = 8, outcome_comparator = ">=") +print(f)
#> (cyl >= 8) ~ wt + gear +#> <environment: base>
(model <- glm(f, mtcars, family = binomial))
#> #> Call: glm(formula = f, family = binomial, data = mtcars) #> #> Coefficients: -#> (Intercept) hp disp -#> -192.6330 0.6459 0.3866 +#> (Intercept) wt gear +#> -33.9388 9.3992 0.5893 #> #> Degrees of Freedom: 31 Total (i.e. Null); 29 Residual #> Null Deviance: 43.86 -#> Residual Deviance: 1.474e-09 AIC: 6
format(model$terms)
#> [1] "(cyl >= 8) ~ hp + disp"
+#> Residual Deviance: 14.21 AIC: 20.21
format(model$terms)
#> [1] "(cyl >= 8) ~ wt + gear"