Skip to content

Chunk options #+echo not correctly parsed #532

@votti

Description

@votti

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    
```

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions