Skip to content
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

Text wrapping with long lists mangles command input #881

Closed
dahcase opened this issue May 24, 2019 · 1 comment
Closed

Text wrapping with long lists mangles command input #881

dahcase opened this issue May 24, 2019 · 1 comment
Assignees

Comments

@dahcase
Copy link

dahcase commented May 24, 2019

Prework

Great package! Apologies in advance if I missed a relevant issue.

Description

Vectors of over 12+ units long (and/or a character limit of about 80+) seems to be throwing the translation of the command into the call for a bit of a loop. Specifically, something about how the command is constructed is between row 12 and 13 introduces another c and then I think this outer c has commas where line breaks are.

Reproducible example

library('drake')
lll = lapply(1:20, function(x) rep('a',x))
ppp = drake_plan(a = target(length(x), transform = map(x =  !!lll, y = !!seq_along(lll), .id = y))) #81 characters seems to be near the max

#seems like the parsing into a call/tidying up the code is causing the issue.
lens = sapply(ppp[,2], function(x) eval(x))
all.equal(lens, sapply(lll, length)) #don't line up
#> [1] "Mean relative difference: 7.25"

Session info

R version 3.6.0 (2019-04-26)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252 LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C LC_TIME=English_United States.1252

attached base packages:
[1] stats graphics grDevices utils datasets methods base

other attached packages:
[1] reprex_0.3.0 drake_7.3.0

loaded via a namespace (and not attached):
[1] Rcpp_1.0.1 ps_1.3.0 digest_0.6.19 R6_2.4.0 backports_1.1.4 storr_1.2.1 magrittr_1.5 evaluate_0.13 rlang_0.3.4
[10] fs_1.3.1 callr_3.2.0 whisker_0.3-2 rmarkdown_1.13 tools_3.6.0 igraph_1.2.4.1 processx_3.3.1 xfun_0.7 yaml_2.2.0
[19] compiler_3.6.0 pkgconfig_2.0.2 base64url_1.4 clipr_0.6.0 htmltools_0.3.6 knitr_1.23

Expected output

Admittedly, the plan does not have an output, but I would expect a vector of 1:20

@dahcase dahcase changed the title Text wrapping with long lists introduces errors Text wrapping with long lists mangles command input May 24, 2019
@wlandau
Copy link
Member

wlandau commented May 24, 2019

Glad you spotted this. It will become important for transform = split() on index sets (next CRAN release, end of this section). Fixed in f1b45c6.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants