rstudio / learnr

Interactive Tutorials with R Markdown
https://pkgs.rstudio.com/learnr
Apache License 2.0
712 stars 239 forks source link

Native pipe (`|>`) incorrectly indicates problem #592

Closed ijlyttle closed 3 years ago

ijlyttle commented 3 years ago

The editor indicates that the native pipe (|>) is a problem.

Example application or steps to reproduce the problem

I use this in a learnr .Rmd file:

```{r pass-the-dots, exercise=TRUE}
library("dplyr")

grouped_height <- function(df, ...) {

  df |>
    dplyr::group_by(...) %>%
    dplyr::summarise(avg_height = mean(height, na.rm = TRUE))
}
```

Describe the problem in detail

image

System details

Output of sessioninfo::session_info():


─ Session info ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
 setting  value                       
 version  R version 4.1.0 (2021-05-18)
 os       macOS Big Sur 11.5.2        
 system   x86_64, darwin17.0          
 ui       RStudio                     
 language (EN)                        
 collate  en_US.UTF-8                 
 ctype    en_US.UTF-8                 
 tz       America/Chicago             
 date     2021-09-25                  

─ Packages ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
 ! package         * version    date       lib source                          
   assertthat        0.2.1      2019-03-21 [1] CRAN (R 4.1.0)                  
   bit               4.0.4      2020-08-04 [1] CRAN (R 4.1.0)                  
   bit64             4.0.5      2020-08-30 [1] CRAN (R 4.1.0)                  
   blob              1.2.2      2021-07-23 [1] CRAN (R 4.1.0)                  
   cachem            1.0.6      2021-08-19 [1] CRAN (R 4.1.0)                  
   callr             3.7.0      2021-04-20 [1] CRAN (R 4.1.0)                  
   cli               3.0.1      2021-07-17 [1] CRAN (R 4.1.0)                  
   crancache         0.0.0.9001 2021-09-24 [1] Github (r-lib/crancache@7ea4e47)
   cranlike          1.0.2      2018-11-26 [1] CRAN (R 4.1.0)                  
   crayon            1.4.1      2021-02-08 [1] CRAN (R 4.1.0)                  
   curl              4.3.2      2021-06-23 [1] CRAN (R 4.1.0)                  
   DBI               1.1.1      2021-01-15 [1] CRAN (R 4.1.0)                  
   debugme           1.1.0      2017-10-22 [1] CRAN (R 4.1.0)                  
   desc              1.3.0      2021-03-05 [1] CRAN (R 4.1.0)                  
   devtools        * 2.4.2      2021-06-07 [1] CRAN (R 4.1.0)                  
   digest            0.6.28     2021-09-23 [1] CRAN (R 4.1.0)                  
   dplyr             1.0.7      2021-06-18 [1] CRAN (R 4.1.0)                  
   ellipsis          0.3.2      2021-04-29 [1] CRAN (R 4.1.0)                  
   evaluate          0.14       2019-05-28 [1] CRAN (R 4.1.0)                  
   fansi             0.5.0      2021-05-25 [1] CRAN (R 4.1.0)                  
   fastmap           1.1.0      2021-01-25 [1] CRAN (R 4.1.0)                  
   fs                1.5.0      2020-07-31 [1] CRAN (R 4.1.0)                  
   generics          0.1.0      2020-10-31 [1] CRAN (R 4.1.0)                  
   glue              1.4.2      2020-08-27 [1] CRAN (R 4.1.0)                  
   htmltools         0.5.2      2021-08-25 [1] CRAN (R 4.1.0)                  
 V htmlwidgets       1.5.3      2021-09-08 [1] CRAN (R 4.1.0)                  
 V httpuv            1.6.1      2021-09-09 [1] CRAN (R 4.1.0)                  
   jsonlite          1.7.2      2020-12-09 [1] CRAN (R 4.1.0)                  
   knitr             1.34       2021-09-09 [1] CRAN (R 4.1.0)                  
 V later             1.2.0      2021-08-18 [1] CRAN (R 4.1.0)                  
 V learnr            0.10.1     2021-09-25 [1] Github (rstudio/learnr@3257461) 
   learnr.tidyeval * 0.0.0.9000 2021-09-25 [1] local                           
   lifecycle         1.0.1      2021-09-24 [1] CRAN (R 4.1.0)                  
   magrittr          2.0.1      2020-11-17 [1] CRAN (R 4.1.0)                  
   markdown          1.1        2019-08-07 [1] CRAN (R 4.1.0)                  
   memoise           2.0.0      2021-01-26 [1] CRAN (R 4.1.0)                  
   mime              0.11       2021-06-23 [1] CRAN (R 4.1.0)                  
   parsedate         1.2.1      2021-04-20 [1] CRAN (R 4.1.0)                  
   pillar            1.6.2      2021-07-29 [1] CRAN (R 4.1.0)                  
   pkgbuild          1.2.0      2020-12-15 [1] CRAN (R 4.1.0)                  
   pkgconfig         2.0.3      2019-09-22 [1] CRAN (R 4.1.0)                  
   pkgload           1.2.1      2021-04-06 [1] CRAN (R 4.1.0)                  
   prettyunits       1.1.1      2020-01-24 [1] CRAN (R 4.1.0)                  
   processx          3.5.2      2021-04-30 [1] CRAN (R 4.1.0)                  
   promises          1.2.0.1    2021-02-11 [1] CRAN (R 4.1.0)                  
   ps                1.6.0      2021-02-28 [1] CRAN (R 4.1.0)                  
   purrr             0.3.4      2020-04-17 [1] CRAN (R 4.1.0)                  
   R6                2.5.1      2021-08-19 [1] CRAN (R 4.1.0)                  
   rappdirs          0.3.3      2021-01-31 [1] CRAN (R 4.1.0)                  
   Rcpp              1.0.7      2021-07-07 [1] CRAN (R 4.1.0)                  
   rematch2          2.1.2      2020-05-01 [1] CRAN (R 4.1.0)                  
   remotes           2.4.0      2021-06-02 [1] CRAN (R 4.1.0)                  
   reprex          * 2.0.1      2021-08-05 [1] CRAN (R 4.1.0)                  
   rlang             0.4.11     2021-04-30 [1] CRAN (R 4.1.0)                  
 V rmarkdown         2.10       2021-09-14 [1] CRAN (R 4.1.0)                  
   rprojroot         2.0.2      2020-11-15 [1] CRAN (R 4.1.0)                  
   rsconnect         0.8.18     2021-05-24 [1] CRAN (R 4.1.0)                  
   RSQLite           2.2.8      2021-08-21 [1] CRAN (R 4.1.0)                  
   rstudioapi        0.13       2020-11-12 [1] CRAN (R 4.1.0)                  
   se.tools        * 0.2.2.9000 2021-09-24 [1] local                           
   sessioninfo       1.1.1      2018-11-05 [1] CRAN (R 4.1.0)                  
 V shiny             1.6.0      2021-09-22 [1] CRAN (R 4.1.0)                  
   testthat          3.0.4      2021-07-01 [1] CRAN (R 4.1.0)                  
   tibble            3.1.4      2021-08-25 [1] CRAN (R 4.1.0)                  
   tidyselect        1.1.1      2021-04-30 [1] CRAN (R 4.1.0)                  
   usethis         * 2.0.1      2021-02-10 [1] CRAN (R 4.1.0)                  
   utf8              1.2.2      2021-07-24 [1] CRAN (R 4.1.0)                  
   vctrs             0.3.8      2021-04-29 [1] CRAN (R 4.1.0)                  
   withr             2.4.2      2021-04-18 [1] CRAN (R 4.1.0)                  
   xfun              0.26       2021-09-14 [1] CRAN (R 4.1.0)                  
   xtable            1.8-4      2019-04-21 [1] CRAN (R 4.1.0)                  
   yaml              2.2.1      2020-02-01 [1] CRAN (R 4.1.0)                  

[1] /Library/Frameworks/R.framework/Versions/4.1/Resources/library

 V ── Loaded and on-disk version mismatch.
gadenbuie commented 3 years ago

Thanks @ijlyttle! Can you try the version in #595 and let me know if that resolves the issue for you?

devtools::install_github("rstudio/learnr@592-native-pipe")
ijlyttle commented 3 years ago

Hi @gadenbuie - works great, thanks! Sorry for delay in reply, I took an "issues sabbatical" and getting back now (realizing I should have kept an eye open for this).