Unexpected Token with piped long text blocks

I don't think this is expected behavior. It is marking a red checkmark saying "unexpected token '%>%'" however, this section runs perfectly, and this token is present within rstudio's current 1.2.5 release.

library(magrittr)
library(stringr)
"For some reason this message is having an issue with the pipe. It seems that
because this comment is on more than one line, that there is something wrong
with the formatting." %>% str_wrap %>% message


OR

# > sessionInfo()
# R version 3.6.3 (2020-02-29)
# Platform: x86_64-w64-mingw32/x64 (64-bit)
# Running under: Windows 10 x64 (build 17763)
# > rstudioapi::versionInfo()
# $mode [1] "desktop"
# $version [1] '1.3.884'
# $release_name [1] "Middlemist Red"

I can't reproduce your issue with a very similar setup, do you have any other information that might be relevant to reproduce?

I installed the Rstudio on a different computer to the same effect.

> rstudioDiagnosticsReport()
Error in system(binaryPath, intern = TRUE) : 'C:\Program' not found
> devtools::session_info()
─ Session info ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
 setting  value                       
 version  R version 3.6.3 (2020-02-29)
 os       Windows 10 x64              
 system   x86_64, mingw32             
 ui       RStudio                     
 language (EN)                        
 collate  English_United States.1252  
 ctype    English_United States.1252  
 tz       America/New_York            
 date     2020-03-14                  

─ Packages ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
 package     * version   date       lib source        
 assertthat    0.2.1     2019-03-21 [1] CRAN (R 3.6.0)
 backports     1.1.5     2019-10-02 [1] CRAN (R 3.6.1)
 bitops        1.0-6     2013-08-17 [1] CRAN (R 3.6.0)
 callr         3.4.0     2019-12-09 [1] CRAN (R 3.6.2)
 cli           2.0.0     2019-12-09 [1] CRAN (R 3.6.2)
 crayon        1.3.4     2017-09-16 [1] CRAN (R 3.6.0)
 curl          4.3       2019-12-02 [1] CRAN (R 3.6.2)
 desc          1.2.0     2018-05-01 [1] CRAN (R 3.6.0)
 devtools      2.2.1     2019-09-24 [1] CRAN (R 3.6.1)
 digest        0.6.23    2019-11-23 [1] CRAN (R 3.6.2)
 ellipsis      0.3.0     2019-09-20 [1] CRAN (R 3.6.1)
 fansi         0.4.0     2018-10-05 [1] CRAN (R 3.6.0)
 fs            1.3.1     2019-05-06 [1] CRAN (R 3.6.0)
 glue          1.3.1     2019-03-12 [1] CRAN (R 3.6.0)
 magrittr      1.5       2014-11-22 [1] CRAN (R 3.6.0)
 memoise       1.1.0     2017-04-21 [1] CRAN (R 3.6.0)
 pkgbuild      1.0.6     2019-10-09 [1] CRAN (R 3.6.2)
 pkgload       1.0.2     2018-10-29 [1] CRAN (R 3.6.0)
 prettyunits   1.0.2     2015-07-13 [1] CRAN (R 3.6.0)
 processx      3.4.1     2019-07-18 [1] CRAN (R 3.6.1)
 ps            1.3.0     2018-12-21 [1] CRAN (R 3.6.0)
 R6            2.4.1     2019-11-12 [1] CRAN (R 3.6.2)
 Rcpp          1.0.3     2019-11-08 [1] CRAN (R 3.6.2)
 RCurl         1.95-4.12 2019-03-04 [1] CRAN (R 3.6.0)
 remotes       2.1.0     2019-06-24 [1] CRAN (R 3.6.0)
 rlang         0.4.2     2019-11-23 [1] CRAN (R 3.6.2)
 rprojroot     1.3-2     2018-01-03 [1] CRAN (R 3.6.0)
 rsconnect     0.8.16    2019-12-13 [1] CRAN (R 3.6.2)
 rstudioapi    0.10      2019-03-19 [1] CRAN (R 3.6.0)
 sessioninfo   1.1.1     2018-11-05 [1] CRAN (R 3.6.0)
 testthat      2.3.1     2019-12-01 [1] CRAN (R 3.6.2)
 usethis       1.5.1     2019-07-04 [1] CRAN (R 3.6.1)
 withr         2.1.2     2018-03-15 [1] CRAN (R 3.6.0)

[1] C:/Users/private/Documents/R/win-library/3.6
[2] C:/Program Files/R/R-3.6.3/library
> Sys.info()
         sysname          release          version         nodename          machine            login             user   effective_user 
       "Windows"         "10 x64"    "build 18363" "PRIVATE_LAPTOP"         "x86-64"        "private"        "private"        "private" 
> devtools::r_env_vars()
                                                                           R_LIBS 
"C:/Users/private/Documents/R/win-library/3.6;C:/Program Files/R/R-3.6.3/library" 
                                                                           CYGWIN 
                                                               "nodosfilewarning" 
                                                                          R_TESTS 
                                                                               "" 
                                                                        R_BROWSER 
                                                                          "false" 
                                                                      R_PDFVIEWER 
                                                                          "false" 
                                                                         NOT_CRAN 
                                                                           "true" 

I took screenshots of all my general options as well.



image

Would it make any difference if you ran the library(magrittr) command ?

1 Like

No. Originally I had, as you can see. Also, I used a division modulus pipe in the second example to get around that.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.