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
Refusal to scan all scripts either with scan_project_files() & create_checkpoint() #308
Comments
Can you try running |
The results are identical and displayed below. Disclaimer : first time using the R GUI. I modified the script to add a code-line setting the directory to the Rproject location (seems to me the closer way to reproduce what I did with RStudio while using the R GUI). R session info
Script and Consol results
|
I can run |
The Rmd files are sure to contain text with confidential information. However :
I can produce a copy of these files only containing these code sections right away. Would it be ok in terms of reproductibility ? Otherwise, I will have to review the terms of the agreement and anonymized the files if necessary/accordingly ; but I will take a bit of time to provide them. |
Sure, you can send the copy. |
Here are the copy of the accessible part of the file "02-Analyse_de_structure_brute.R"
And of the file "03-Production_des_tableaux_de_travail.R"
|
I haven't put the equivalent Rmd files because they contain the same code. However, weirdly enough, I notice the warning messages only concerns R and Rmd files containing library() calls ... which would mean the function know somehow which scripts to scan if it worked through without accessing them ? |
I can scan the files provided. I suspect there's an encoding issue here, which may be masked by how you've copied the contents to Github. Can you attach the files rather than putting them in a comment? |
I wanted to do just that but file attachment is not supported for .R files in the comment box. |
You can zip up the files and attach them that way. |
I should have thought about it. |
Ok, I can reproduce the error now.
And line 271 of the file is
When I remove the è from Synthèse, it works. It also works if I put the variable name in backquotes ``. I'm not actually sure if R supports non-ASCII characters in symbols, or if it does, what assumptions it makes. I'd suggest using only ASCII varnames, because I'm sure there are other areas where this is going to bite you. |
Opening via a connection (so that I can specify the encoding) also works, but as said, this may be fragile: f <- file("~/misc/checkpoint/repro/02-Analyse_de_structure_brute.R", encoding="UTF-8", open="r")
z <- parse(f) |
You can also specify the default encoding for files via options(encoding="UTF-8")
z <- parse("~/misc/checkpoint/repro/02-Analyse_de_structure_brute.R") I think this is the best solution, because there will be other places where encoding becomes an issue. PS. your other file doesn't parse correctly because |
I must say I'm embarassed that it came down to such a silly mistake on my part : I thought about avoiding special characters in naming objects but it didn't cross my mind it must also apply to column names of dataframe if I call one of them. I see no problem in just renaming this element with ASCII characters. Since these characters does not cause issues when in a character string, I can always rename the column once I've finished when I need to print/save/display them. I just did that and it works as expected. |
Hello,
Trying to implement a checkpoint for my project resulted in the functions
scan_project_files()
&create_checkpoint()
refusing to scan any of my script (either R or RMarkdown).I put copies of the R & Rstudio session infos, the script setting up the checkpoint with the results on the console below.
I'm a bit confused the package & functions failed this way. After tweaking and reseraching the issues of this Github page (both opened and closed), I'm still unable to pinpoint what exactly failed.
This are relevant (I think) information I collected while trying to debug the issue :
I search the Issues page for both the main console result ('Following files could not be scanned') adn 'git" to check if this issue was solved. In the first cas, I see no previous issue published, for the second there is one on git integration but is closed (I supposed it is solved) but do not contain info pointing me to a way to solve the issue in my original R project.
I strongly suspect that the problem originates in the fact I use version control for this project.
Do you confirm there is an incompatibility between usig Git/GitHub and the package ?
I fell the need to post this issue despite the results exposed above because version control is most of the time part of a reproductible research/data analysis R project and find odd the package failed in this circumstances.
If not, is there a piece of documentation (not found yet after seaching) indicating special parmaters or procedures for using the package with Git/GitHub ?
Best regards,
R & R Studio session info
Script and Consol results
The text was updated successfully, but these errors were encountered: