We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
width.cutoff
deparse
Hi Yihui :)
EDIT: 2018-FEB-19: I did a hack who tries to fit the desired width, and works for many cases. Reference: #71.
I'm using formatR inside bookdown and I found an issue when creating the PDF. The maximum width doesn't work for the code (but it does for comments!)
Easily reproducible at formatR, copy the following lines (using minimum line width=56)
Input:
# Keeping all columns except the ones present in 'vars_to_remove' vector heart_disease_2=select(heart_disease, -one_of(vars_to_remove)) aasd = select(daa, -one_of(holas), -one_of(holas), -one_of(holas))
Output:
# Keeping all columns except the ones present in # 'vars_to_remove' vector heart_disease_2 = select(heart_disease, -one_of(vars_to_remove)) aasd = select(daa, -one_of(holas), -one_of(holas), -one_of(holas))
Width line 3: 64 Width line 3: 66
So it didn't re adjust the with for the code.
Afer doing several test, I tracked the problem to what it seem its origin: base::deparse function.
base::deparse
Testing from your code:
text="# Keeping all columns except the ones present in 'vars_to_remove' vector heart_disease_2 = select(heart_disease, -one_of(vars_to_remove)) aasd = select(daa, -one_of(holas), -one_of(holas), -one_of(holas))" exprs = parse_only(text) base::deparse(exprs, width) [1] "expression(heart_disease_2 = select(heart_disease, -one_of(vars_to_remove)), " [2] " aasd = select(daa, -one_of(holas), -one_of(holas), -one_of(holas)))"
If I try lower width, let's say 40, it adjust the 3rd line but the max len is 50...
I would have like to fix it myself, but I'm lack of ideas to debug deparse function... Any ideas?
Related to this case: https://stackoverflow.com/questions/20778635/formatr-width-cutoff-issue
Thanks!
The text was updated successfully, but these errors were encountered:
3064d8d
With #71 just merged, it seems it works okay for this particular case now:
> tidy_source(width.cutoff = I(56)) # Keeping all columns except the ones present in # 'vars_to_remove' vector heart_disease_2 = select(heart_disease, -one_of(vars_to_remove)) aasd = select(daa, -one_of(holas), -one_of(holas), -one_of(holas))
Sorry, something went wrong.
No branches or pull requests
Hi Yihui :)
EDIT: 2018-FEB-19: I did a hack who tries to fit the desired width, and works for many cases. Reference: #71.
I'm using formatR inside bookdown and I found an issue when creating the PDF. The maximum width doesn't work for the code (but it does for comments!)
Easily reproducible at formatR, copy the following lines (using minimum line width=56)
Input:
Output:
Width line 3: 64
Width line 3: 66
So it didn't re adjust the with for the code.
Afer doing several test, I tracked the problem to what it seem its origin:
base::deparse
function.Testing from your code:
If I try lower width, let's say 40, it adjust the 3rd line but the max len is 50...
I would have like to fix it myself, but I'm lack of ideas to debug
deparse
function... Any ideas?Related to this case: https://stackoverflow.com/questions/20778635/formatr-width-cutoff-issue
Thanks!
The text was updated successfully, but these errors were encountered: