KentonWhite / ProjectTemplate

A template utility for R projects that provides a skeletal project.
http://projecttemplate.net
GNU General Public License v3.0
622 stars 159 forks source link

Autoload stopped working after update #308

Closed lf-araujo closed 3 years ago

lf-araujo commented 3 years ago

Report an Issue / Request a Feature

I'm submitting a (Check one with "x") :


Issue Severity Classification -

(Check one with "x") :

Expected Behavior

Long time PT user, expected my projects to load normally.

Current Behavior

Instead, after updating the system to R4.0 and reinstalling PT the following error appears:

Quitting from lines 18-56 (2020-11-11-initial-inspection.rmd)
Error in if (!config$cache_file_format %in% names(.cache.formats)) { :
  argument is of length zero
Steps to Reproduce Behavior

ProjectTemplate::load.project()

My global.dcf reads:

version: 0.10.1
data_loading: TRUE
data_loading_header: TRUE
data_ignore:
cache_loading: TRUE
recursive_loading: FALSE
munging: TRUE
logging: FALSE
logging_level: INFO
load_libraries: FALSE
libraries: reshape2, plyr, tidyverse, stringr, lubridate
as_factors: FALSE
tables_type: tibble
attach_internal_libraries: FALSE
cache_loaded_data: FALSE
sticky_variables: NONE
underscore_variables: TRUE
cache_file_format: RData
Screenshots

image

Version Information
R version 4.0.4 (2021-02-15)
Platform: x86_64-solus-linux-gnu (64-bit)
Running under: Solus 4.2 Fortitude

Matrix products: default
BLAS/LAPACK: /usr/lib64/haswell/libopenblas_haswellp-r0.3.13.so

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               LC_TIME=pt_BR.UTF-8        LC_COLLATE=en_US.UTF-8     LC_MONETARY=pt_BR.UTF-8
 [6] LC_MESSAGES=en_US.UTF-8    LC_PAPER=pt_BR.UTF-8       LC_NAME=C                  LC_ADDRESS=C               LC_TELEPHONE=C
[11] LC_MEASUREMENT=pt_BR.UTF-8 LC_IDENTIFICATION=C

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

other attached packages:
 [1] forcats_0.5.1          stringr_1.4.0          dplyr_1.0.4            purrr_0.3.4            readr_1.4.0            tidyr_1.1.2
 [7] tibble_3.1.0           tidyverse_1.3.0        ggplot2_3.3.3          naniar_0.6.0           visdat_0.5.3           here_1.0.1
[13] summarytools_0.9.8     ProjectTemplate_0.10.1 rmarkdown_2.7          nvimcom_0.9-82

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.6         lubridate_1.7.10   ps_1.6.0           assertthat_0.2.1   rprojroot_2.0.2    digest_0.6.27      utf8_1.1.4         R6_2.5.0
 [9] cellranger_1.1.0   plyr_1.8.6         backports_1.2.1    reprex_1.0.0       evaluate_0.14      httr_1.4.2         pillar_1.5.0       rlang_0.4.10
[17] readxl_1.3.1       rstudioapi_0.13    magick_2.6.0       checkmate_2.0.0    pander_0.6.3       munsell_0.5.0      broom_0.7.5        compiler_4.0.4
[25] modelr_0.1.8       xfun_0.21          pkgconfig_2.0.3    base64enc_0.1-3    htmltools_0.5.1.1  tcltk_4.0.4        tidyselect_1.1.0   codetools_0.2-18
[33] matrixStats_0.58.0 fansi_0.4.2        crayon_1.4.1       dbplyr_2.1.0       withr_2.4.1        grid_4.0.4         jsonlite_1.7.2     gtable_0.3.0
[41] lifecycle_1.0.0    DBI_1.1.1          magrittr_2.0.1     scales_1.1.1       cli_2.3.1          stringi_1.5.3      pryr_0.1.4         fs_1.5.0
[49] xml2_1.3.2         ellipsis_0.3.1     rapportools_1.0    generics_0.1.0     vctrs_0.3.6        tools_4.0.4        glue_1.4.2         hms_1.0.0
[57] yaml_2.2.1         colorspace_2.0-0   rvest_0.3.6        knitr_1.31         haven_2.3.1
Possible Solution
KentonWhite commented 3 years ago

@lf-araujo Are you running this project through a RMarkDown file? The error references it is being called from 2020-11-11-initial-inspection.rmd If you are can you send the RMarkDown file?

lf-araujo commented 3 years ago

Sure, please find in the gist: https://gist.github.com/lf-araujo/de1357b24a98a463429db6ae57da61af

KentonWhite commented 3 years ago

@lf-araujo Thanks! And just to check, are you getting this error if you run ProjectTemplate::load.project() from the terminal in the ProjectTemplate directory?

lf-araujo commented 3 years ago

It's on vim, which is set to run from the root. But, there is something wrong with the installation, when I run from the root folder another error appears:

image

lf-araujo commented 3 years ago

And from RStudio:

image

KentonWhite commented 3 years ago

@lf-araujo Can you do this and let me know if you get a different response:

library(ProjectTemplate)
load.project()
lf-araujo commented 3 years ago

Now the error changes again:

image

KentonWhite commented 3 years ago

Progress! Lets see if a default project works for you. Can you go above one directory, make a new project, enter the project and then run ProjectTemplate:

setwd('..')
create.project('debug_pt')
setwd('debug_pt')
load.project()
lf-araujo commented 3 years ago

I think there were old cached ProjectTemplate functions in the session, I emptied the cache and restarted the session anew. And now the errors disappeared! In all envs: vim, Rstudio, R

Thanks for the quick support!

Your instructions above runs normally too.

Will close it, if I find out what happened I update you here.

lf-araujo commented 3 years ago

I think there were old cached ProjectTemplate functions in the session, I emptied the cache and restarted the session anew. And now the errors disappeared! In all envs: vim, Rstudio, R

Thanks for the quick support!

Your instructions above runs normally too.

Will close it, if I find out what happened I update you here.

KentonWhite commented 3 years ago

@lf-araujo Yes please keep me posted! Glad it is working for you again :)