mitchelloharawild / vitae

R Markdown Résumés and CVs
https://pkg.mitchelloharawild.com/vitae/
1.23k stars 241 forks source link

Can't convert <character> to <logical> error using brief_entries() #116

Closed PsychlytxTD closed 4 years ago

PsychlytxTD commented 4 years ago

Hi Mitchell, the code below worked a few weeks ago (note that the "skills.csv" is appended below). I know thatbrief_entries() isn't intended to list skill/technology pairings, but I was using it this way previously and looked very good.

skills<- read_csv(here("data", "skills.csv"))

skills %>% dplyr::filter(Tag == "skills") %>%     ##yes I realise the filter statement is redundant - it's from 
                                                                                   ##old code...
brief_entries(
when = When,
what = What
)

Since then, I installed/updated some packages (can't recall exactly which) and now I get a recurrent error.

Error: Assigned data `""` must be compatible with existing data.
i Error occurred for column `with`.
x Can't convert <character> to <logical>.

I tried installing a previous version of vitae - with no effect.

Below is the csv file:

When,What,Tag R & Rstudio,"Package development, data visualisation, biostatistics, machine learning",skills Shiny,Interactive web applications & dashboards,skills R Markdown,Static & interactive reports & presentations,skills SQL,Database design and querying,skills Linux/Bash,"Automation, file management",skills Git & Github,Version control & collaboration,skills Python,Data analysis & automation,skills Regular Expressions,String manipulation,skills SPSS,Statistical analysis,skills Amazon Web Services (AWS),Web application/database hosting,skills Docker,Containerisation of data science environments,skills "Javascript, HTML, CSS, Webflow","Web development, front-end design & styling ",skills Microsoft Office,Data collection & storage/presentations/documents,skills French Language,Fluent written & spoken communication,skills

sessionInfo()
R version 3.6.2 (2019-12-12)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS Catalina 10.15.1

Matrix products: default
BLAS:   /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.6/Resources/lib/libRlapack.dylib

locale:
[1] en_AU.UTF-8/en_AU.UTF-8/en_AU.UTF-8/C/en_AU.UTF-8/en_AU.UTF-8

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

other attached packages:
 [1] glue_1.4.0        readxl_1.3.1      here_0.1          lubridate_1.7.4  
 [5] forcats_0.4.0     stringr_1.4.0     dplyr_0.8.99.9002 purrr_0.3.3      
 [9] readr_1.3.1       tidyr_1.0.2       tibble_3.0.0      ggplot2_3.2.1    
[13] tidyverse_1.3.0   vitae_0.2.0      

loaded via a namespace (and not attached):
 [1] tidyselect_1.0.0  xfun_0.12         haven_2.2.0       lattice_0.20-38  
 [5] colorspace_1.4-1  vctrs_0.2.99.9011 generics_0.0.2    htmltools_0.4.0  
 [9] yaml_2.2.1        rlang_0.4.5.9000  pillar_1.4.3      withr_2.1.2      
[13] DBI_1.1.0         dbplyr_1.4.2      modelr_0.1.5      lifecycle_0.2.0  
[17] munsell_0.5.0     gtable_0.3.0      cellranger_1.1.0  rvest_0.3.5      
[21] evaluate_0.14     knitr_1.27        fansi_0.4.1       broom_0.5.4      
[25] Rcpp_1.0.3        backports_1.1.5   scales_1.1.0      jsonlite_1.6     
[29] fs_1.4.1          hms_0.5.3         digest_0.6.25     stringi_1.4.5    
[33] rprojroot_1.3-2   grid_3.6.2        cli_2.0.2         tools_3.6.2      
[37] magrittr_1.5      lazyeval_0.2.2    crayon_1.3.4      pkgconfig_2.0.3  
[41] ellipsis_0.3.0    xml2_1.2.2        reprex_0.3.0      assertthat_0.2.1 
[45] rmarkdown_2.1     httr_1.4.1        rstudioapi_0.10   R6_2.4.1         
[49] nlme_3.1-142      compiler_3.6.2  
zizekw commented 4 years ago

I had a similar issue/errors with brief_entries(). In my case, I had recently updated R + misc. packages which I assume led to the error (?).

Initially, I had something along the lines of the following which was working a few weeks ago, but recently started throwing an error when trying to knit:

tribble(~ what, ~ when,
"foo", "foo") %>%
brief_entries(what = what, when = when)

But upon switching to this I no longer got the error:

tribble(~ what, ~ when, ~ with,
"foo", "foo", "") %>%
brief_entries(what = what, when = when, with = with)

So I'm not sure of the root issue - but by supplying all parameters explicitly, you might be able to have a bandaid solution for the problem like I did. I hope that helps!

mitchelloharawild commented 4 years ago

These issues are from the tibble 3.0.0 release, as discussed in #108 They should be fixed in the dev version of the package which will be submitted to CRAN ASAP.

PsychlytxTD commented 4 years ago

Thanks very much to both of you - with this info I'll find a workaround. Cheers

mitchelloharawild commented 4 years ago

Fixed in the version now on CRAN.