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

Chunk options #+echo not correctly parsed #532

Closed
votti opened this issue Apr 15, 2024 · 1 comment
Closed

Chunk options #+echo not correctly parsed #532

votti opened this issue Apr 15, 2024 · 1 comment

Comments

@votti
Copy link

votti commented Apr 15, 2024

Symptom

Running the demo data I got errors:

Pipeline_SampleAnnotation_R:

processing file: /tmp/Rtmp4HVNRw/file1b74e41ef83803/SampleAnnotation.spin.Rmd
  |...............................                                                             |  33%                  
Quitting from lines  at lines 2-36 (/tmp/Rtmp4HVNRw/file1b74e41ef83803/SampleAnnotation.spin.Rmd)
Error:
! object 'sa' not found

MonoallelicExpression_pipeline_MAE_Results_R:

processing file: /tmp/RtmpxJMIWB/file1d4052152736d3/Results.spin.Rmd
  |.................................                                                           |  36% [unnamed-chunk-2]
Quitting from lines  at lines 160-164 [unnamed-chunk-2] (/tmp/RtmpxJMIWB/file1d4052152736d3/Results.spin.Rmd)
Error:
! object 'melt_dt' not found
Backtrace:
 1. ggplot2::ggplot(melt_dt, aes(variable, value))

Debugging

Investigating I noticed these errors were directly downstream of #+echo=F.

Manually converting the R script using knitr:spin I noticed that this accidentally gets converted into:

{recho=F}
```

## Proposed solution
Add a space between `#+` and `echo`: all `#+echo` comments with `#+ echo` 

## Environment
```
R version 4.3.3 (2024-02-29)
Platform: x86_64-conda-linux-gnu (64-bit)
Running under: Ubuntu 23.10

Matrix products: default
BLAS/LAPACK: /home/vitoz/mambaforge/envs/drop_env/lib/libopenblasp-r0.3.27.so;  LAPACK version 3.12.0

locale:
[1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
[3] LC_TIME=de_CH.UTF-8        LC_COLLATE=en_US.UTF-8    
[5] LC_MONETARY=de_CH.UTF-8    LC_MESSAGES=en_US.UTF-8   
[7] LC_PAPER=de_CH.UTF-8       LC_NAME=C                 
[9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=de_CH.UTF-8 LC_IDENTIFICATION=C       

time zone: Europe/Zurich
tzcode source: system (glibc)

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

other attached packages:
[1] knitr_1.46        tidyr_1.3.1       magrittr_2.0.3    data.table_1.15.2

loaded via a namespace (and not attached):
[1] utf8_1.2.4       R6_2.5.1         tidyselect_1.2.0 xfun_0.43       
[5] glue_1.7.0       tibble_3.2.1     pkgconfig_2.0.3  dplyr_1.1.4     
[9] generics_0.1.3   lifecycle_1.0.4  cli_3.6.2        fansi_1.0.6     
[13] vctrs_0.6.5      compiler_4.3.3   purrr_1.0.2      tools_4.3.3     
[17] evaluate_0.23    pillar_1.9.0     yaml_2.3.8       rlang_1.1.3    
```
votti pushed a commit to FroeseLab/drop that referenced this issue Apr 15, 2024
Fixes: gagneurlab#532

As described in the issue, there recent versions of `knitr` wrongly
converted `#+argument` comments without a space before the argumnet into
`{rargument}`. Adding a space fixes this.
@vyepez88
Copy link
Collaborator

Many thanks! I also noticed this on Friday. I'm meeting the rest of the development meeting later today to address this today!

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

Successfully merging a pull request may close this issue.

2 participants