The hardware and bandwidth for this mirror is donated by METANET, the Webhosting and Full Service-Cloud Provider.
If you wish to report a bug, or if you are interested in having us mirror your free-software or open-source project, please feel free to contact us at mirror[@]metanet.ch.

Corner Cases

John Mount

2023-08-19

wrapr::let() is designed to get several important corner cases correct: including substitutions that are disjoint from the expression and symbol swaps.

library("wrapr")

X <- 1
Y <- 2

let(
 c(),
  debugPrint = TRUE,
  X + Y
)
## list()
## X + Y
## [1] 3
let(
 c(),
  debugPrint = TRUE,
  subsMethod = 'langsubs',
  X + Y
)
## list()
## X + Y
## [1] 3
let(
 c(),
  debugPrint = TRUE,
  subsMethod = 'stringsubs',
  X + Y
)
## list()
## X + Y
## [1] 3
let(
 c(),
  debugPrint = TRUE,
  subsMethod = 'subsubs',
  X + Y
)
## list()
## X + Y
## [1] 3
library("wrapr")

X <- 1
Y <- 2

let(
  c(X='Y', Y='X'),
  debugPrint = TRUE,
  X + Y
)
## $X
## [1] "Y"
## 
## $Y
## [1] "X"
## 
## Y + X
## [1] 3
let(
  c(X='Y', Y='X'),
  debugPrint = TRUE,
  subsMethod = 'langsubs',
  X + Y
)
## $X
## [1] "Y"
## 
## $Y
## [1] "X"
## 
## Y + X
## [1] 3
let(
  c(X='Y', Y='X'),
  debugPrint = TRUE,
  subsMethod = 'stringsubs',
  X + Y
)
## $X
## [1] "Y"
## 
## $Y
## [1] "X"
## 
## expression(Y + X)
## [1] 3
let(
  c(X='Y', Y='X'),
  debugPrint = TRUE,
  subsMethod = 'subsubs',
  X + Y
)
## $X
## [1] "Y"
## 
## $Y
## [1] "X"
## 
## Y + X
## [1] 3

These binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.