-
Notifications
You must be signed in to change notification settings - Fork 186
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Passing ... logicals as T or F fails through dfm(x, ...) #721
Comments
It seems that both fun1 <- function(a, b, ...) {
args <- as.list(match.call())
cat("fun1 args = \n")
print(args)
fun2(b, ...)
}
fun2 <- function(b, ...){
args <- as.list(match.call())
cat("fun2 args = \n")
print(args)
cat("b =", b , "\n")
}
fun1(b = TRUE, c = TRUE) # OK
fun1(b = FALSE, c = FALSE) # OK
fun1(b = T, c = T)
# fun1 args =
# [[1]]
# fun1
#
# $b
# T
#
# $c
# T
#
# fun2 args =
# [[1]]
# fun2
#
# $b
# b
#
# $c
# ..1
#
# b = TRUE
fun1(b = F, c = F)
# fun1 args =
# [[1]]
# fun1
#
# $b
# F
#
# $c
# F
#
# fun2 args =
# [[1]]
# fun2
#
# $b
# b
#
# $c
# ..1
#
# b = FALSE
|
I believe this is related. If not tell me and I'll file an issue elsewhere:
The first two
This is particularly problematic when quanteda is being used by another package and needs to pass these arguments in by reference. |
Earlier
for me. This was using the github version of quanteda. But the latest CRAN version seems ok. |
Odd... works fine for me: > sessionInfo()
R version 3.4.0 (2017-04-21)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS Sierra 10.12.4
Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.4/Resources/lib/libRlapack.dylib
locale:
[1] en_GB.UTF-8/en_GB.UTF-8/en_GB.UTF-8/C/en_GB.UTF-8/en_GB.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] quanteda_0.9.9-61
loaded via a namespace (and not attached):
[1] Rcpp_0.12.10 lattice_0.20-35 grid_3.4.0 plyr_1.8.4
[5] gtable_0.2.0 scales_0.4.1 RcppParallel_4.3.20 ggplot2_2.2.1
[9] stringi_1.1.5 lazyeval_0.2.0 data.table_1.10.4 Matrix_1.2-9
[13] fastmatch_1.1-0 tools_3.4.0 munsell_0.4.3 compiler_3.4.0
[17] colorspace_1.3-2 tibble_1.3.0
> dfm("This: contains punctuation.", remove_punct = TRUE)
Document-feature matrix of: 1 document, 3 features (0% sparse).
1 x 3 sparse Matrix of class "dfmSparse"
features
docs this contains punctuation
text1 1 1 1 |
I can fix this, but it will involve rewriting the internal While personally I believe punishment is warranted for using |
This needs to be more robust, since too many people (sadly) use the (sadly) available shortcuts
T
andF
instead ofTRUE
andFALSE
:The text was updated successfully, but these errors were encountered: