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

cloc_remove_comments returning error #8

Open
yonicd opened this issue Nov 9, 2018 · 2 comments
Open

cloc_remove_comments returning error #8

yonicd opened this issue Nov 9, 2018 · 2 comments
Assignees

Comments

@yonicd
Copy link

yonicd commented Nov 9, 2018

> cloc::cloc_remove_comments(source_file = 'README.Rmd')

1 error:
Unable to read:  README.Rmd
Error in file(con, "r") : cannot open the connection
In addition: Warning message:
In file(con, "r") :
  cannot open file 'README.Rmd.nc': No such file or directory
Session info
Session info ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────
 setting  value                       
 version  R version 3.5.1 (2018-07-02)
 os       macOS High Sierra 10.13.6   
 system   x86_64, darwin15.6.0        
 ui       RStudio                     
 language (EN)                        
 collate  en_US.UTF-8                 
 ctype    en_US.UTF-8                 
 tz       America/New_York            
 date     2018-11-09Packages ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
 ! package     * version     date       lib source                            
   assertthat    0.2.0       2017-04-11 [1] CRAN (R 3.5.0)                    
   backports     1.1.2       2017-12-13 [1] CRAN (R 3.5.0)                    
   cli           1.0.1       2018-09-25 [1] CRAN (R 3.5.0)                    
   clipr         0.4.1       2018-06-23 [1] CRAN (R 3.5.0)                    
   cloc          0.3.0       2018-11-09 [1] Github (hrbrmstr/cloc@b406628)    
   covr        * 3.2.0       2018-09-21 [1] CRAN (R 3.5.0)                    
   covrpage    * 0.0.63      2018-11-09 [1] local                             
   crayon        1.3.4       2017-09-16 [1] CRAN (R 3.5.0)                    
   curl          3.2         2018-03-28 [1] CRAN (R 3.5.0)                    
   devtools      1.13.6      2018-06-27 [1] CRAN (R 3.5.0)                    
   digest        0.6.18      2018-10-10 [1] CRAN (R 3.5.0)                    
   DT            0.5         2018-11-05 [1] CRAN (R 3.5.0)                    
   evaluate      0.12        2018-10-09 [1] CRAN (R 3.5.0)                    
   git2r         0.23.0.9000 2018-10-26 [1] Github (ropensci/git2r@f9d78f7)   
   htmltools     0.3.6       2017-04-28 [1] CRAN (R 3.5.0)                    
   htmlwidgets   1.3         2018-09-30 [1] CRAN (R 3.5.0)                    
   knitr       * 1.20        2018-02-20 [1] CRAN (R 3.5.0)                    
   lazyeval      0.2.1       2017-10-29 [1] CRAN (R 3.5.0)                    
   magrittr    * 1.5         2014-11-22 [1] CRAN (R 3.5.0)                    
   memoise       1.1.0       2017-04-21 [1] CRAN (R 3.5.0)                    
   packrat       0.4.9-3     2018-06-01 [1] CRAN (R 3.5.0)                    
   processx      3.2.0.9000  2018-11-02 [1] Github (r-pkgs/processx@8374340)  
   ps            1.2.1       2018-11-06 [1] CRAN (R 3.5.0)                    
   R6            2.3.0       2018-10-04 [1] CRAN (R 3.5.0)                    
 V Rcpp          0.12.19     2018-11-07 [1] CRAN (R 3.5.0)                    
   remotes       1.1.1       2017-12-20 [1] CRAN (R 3.5.0)                    
   rex           1.1.2       2017-10-19 [1] CRAN (R 3.5.0)                    
   rlang         0.3.0.1     2018-10-25 [1] CRAN (R 3.5.0)                    
   rmarkdown     1.10        2018-06-11 [1] CRAN (R 3.5.0)                    
   rprojroot     1.3-2       2018-01-03 [1] CRAN (R 3.5.0)                    
   rstudioapi    0.8         2018-10-02 [1] CRAN (R 3.5.0)                    
   sessioninfo   1.1.0.9001  2018-10-14 [1] Github (r-lib/sessioninfo@9645364)
   testthat    * 2.0.0.9000  2018-09-28 [1] Github (r-lib/testthat@8216ebe)   
   whisker       0.3-2       2013-04-28 [1] CRAN (R 3.5.0)                    
   withr         2.1.2       2018-03-15 [1] CRAN (R 3.5.0)                    

[1] /Users/yonis/Library/R/3.5/library
[2] /Library/Frameworks/R.framework/Versions/3.5/Resources/library

 V ── Loaded and on-disk version mismatch.
@yonicd
Copy link
Author

yonicd commented Nov 9, 2018

figured it out. the path needs to be normalized. can it be normalized internally?

> cloc::cloc_remove_comments(source_file = normalizePath('README.Rmd'))
[1] "knitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#>\"\n)"

@hrbrmstr hrbrmstr self-assigned this Nov 9, 2018
@hrbrmstr
Copy link
Owner

hrbrmstr commented Nov 9, 2018

yep. that's an oversight.

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

No branches or pull requests

2 participants