Closed cforgaci closed 1 year ago
Some questions:
renv
?I am not sure, but looking at the error, creating the test repository is failing, as some of the files created by the repository already exist.
It looks to me as if the installation was taking place within the renv
(for a specific branch? ). Have you checked if there is a README.Rmd
files in any of the mentioned directories?
The error comes from call of this function :
path <- file.path(pkg$path, out_path, save_as)
if (!can_overwrite(path, ask = ask)) {
stop("`", save_as, "` already exists.", call. = FALSE)
}
It would suggest that there is a README.Rmd
that cannot be overwritten?
Some questions:
- Are you trying to install this within
renv
?
Yes, renv
is active.
- Are you working on a specific branch?
I tried both on main and on another branch.
- Are you in a project?
I am in the mintEMU project
I am assuming it is referring to the README.Rmd that rrtools
uses to generate the README.md in the project root. Should I try to remove it?
I am assuming it is referring to the README.Rmd that
rrtools
uses to generate the README.md in the project root. Should I try to remove it?
Looking at the source code, it might be that it might run into similar issues with other automatically created files. I wonder if rrtools
is something needed to recreate the analysis or use the package? I think only suplementary_materials/create_rrtools.R
would need it?
I can run the analysis but I cannot knit, which is not ok. I will try removing files that throw this error and see if I can manage to knit somehow. I will report back once I tried.
Hi @cforgaci ,
I looked at the paper.qmd, and it failed for me too. It seems that the issue comes from the install.packages()
in this statement:
packages <- c(
"here", # Managing paths
"tidyverse", # Data manipulation and visualisation
"tidytext", "SnowballC", "tm", "topicmodels", # Text processing and analysis
"tidygeocoder", # Working with spatial data
"igraph", "ggraph" # Network analysis and visualsation
)
## Load required packages, install them if needed
for (package in packages) {
if (!require(package, character.only = TRUE)) {
install.packages(package)
}
library(package, character.only = TRUE)
}
As explained in this discussion, Knitr
sets up an R session without a CRAN mirror set. So this needs to be explicitly stated or defined in the .Rprofile
. Addapting the install.packages()
call: install.packages(package, "http://cran.us.r-project.org")
did the trick for me. However, I've had a few other issues with knitting:
theses_all
is called, but it's not defined. map_data()
function gave me some issues. Maybe it's masked and should be explicitly called as : ggplot2::map_data()
?emu_theses_top_20
is called but not definedI'm working on a pull request to clean the file. I will also push the updated renv.lock file, and lets see if you can restore it from your side?
@alwil, I need some help with rrtools. For some reason, it seems that it is not installed and when I try to install it, this is what I get:
This is my session info:
Any ideas on how I can solve this issue?