R unable to find repository for package RODBC when deploying - r

When I deploy to shinyapps.io, it gives me an error:
Unable to find repository URL for package RODBC
So when I go to open the chart via URL, it doesn't show anything, because it was unable to connect to the connection I had and load the data into the data frames I had created.
Deploy information:
The package is installed and works normally, even I search the data in my database through it.

After I posted the question in the R (R Community Question) community, I ended up following the steps as directed by #nirgrahamuk, and the error no longer appears!
So I had to update the R version to the latest one, and it worked!
After having executed the commands in R he asked:
> getOption("repos")
CRAN
"https://cran.rstudio.com/"
attr(,"RStudio")
[1] TRUE
> sessionInfo()
R version 3.6.1 (2019-07-05)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 18363)
Matrix products: default
locale:
[1] LC_COLLATE=Portuguese_Brazil.1252 LC_CTYPE=Portuguese_Brazil.1252
[3] LC_MONETARY=Portuguese_Brazil.1252 LC_NUMERIC=C
[5] LC_TIME=Portuguese_Brazil.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] compiler_3.6.1 rsconnect_0.8.16 tools_3.6.1 curl_4.3 jsonlite_1.6.1
[6] digest_0.6.25 openssl_1.4.1 askpass_1.1
After updating the R version:
> getOption("repos")
CRAN
"https://cran.rstudio.com/"
attr(,"RStudio")
[1] TRUE
> sessionInfo()
R version 4.0.2 (2020-06-22)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 18363)
Matrix products: default
locale:
[1] LC_COLLATE=Portuguese_Brazil.1252 LC_CTYPE=Portuguese_Brazil.1252
[3] LC_MONETARY=Portuguese_Brazil.1252 LC_NUMERIC=C
[5] LC_TIME=Portuguese_Brazil.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] reshape2_1.4.4 lubridate_1.7.9 dplyr_1.0.0 DBI_1.1.0 RODBC_1.3-17 timevis_0.5
[7] shiny_1.5.0
loaded via a namespace (and not attached):
[1] Rcpp_1.0.4.6 compiler_4.0.2 pillar_1.4.4 later_1.1.0.1 plyr_1.8.6
[6] tools_4.0.2 digest_0.6.25 evaluate_0.14 jsonlite_1.6.1 lifecycle_0.2.0
[11] tibble_3.0.1 pkgconfig_2.0.3 rlang_0.4.6 cli_2.0.2 rstudioapi_0.11
[16] yaml_2.2.1 curl_4.3 xfun_0.15 fastmap_1.0.1 withr_2.2.0
[21] knitr_1.29 stringr_1.4.0 htmlwidgets_1.5.1 generics_0.0.2 vctrs_0.3.1
[26] askpass_1.1 tidyselect_1.1.0 glue_1.4.1 R6_2.4.1 fansi_0.4.1
[31] rmarkdown_2.3 purrr_0.3.4 magrittr_1.5 promises_1.1.1 htmltools_0.5.0
[36] ellipsis_0.3.1 assertthat_0.2.1 rsconnect_0.8.16 mime_0.9 xtable_1.8-4
[41] httpuv_1.5.4 stringi_1.4.6 openssl_1.4.1 crayon_1.3.4
So the version has been updated from R version 3.6.1 (2019-7-05) to R version 4.0.2 (2020-06-22).
And the error no longer appears:

Related

Loading the package('kableExtra')

I'm a new user to rmarkdown and trying to learn how to format better tables for a report.
I had a report using the package "kableExtra" and it was fine. But now I cannot even load the package anymore and I do not know why.
This is the error I get:
"package of namespace load failed for 'kableExtra' in
library.dynam(lib, package, package.lib): DLL 'systemfonts' not
found: maybe not installed for this architecture? Execution halted"
Anyone can help me, please?
I am using RStudio 2022.02.0 Build 443
and R version 4.1.2 (2021-11-01) -- "Bird Hippie"
Thank you :)
sessionInfo() R version 4.1.2 (2021-11-01) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows 10 x64 (build
19042)
Matrix products: default
locale: [1] LC_COLLATE=English_Canada.1252
LC_CTYPE=English_Canada.1252 LC_MONETARY=English_Canada.1252
LC_NUMERIC=C [5] LC_TIME=English_Canada.1252
attached base packages: [1] stats graphics grDevices utils
datasets methods base
other attached packages: [1] dplyr_1.0.8
loaded via a namespace (and not attached): [1] pillar_1.7.0
compiler_4.1.2 remotes_2.4.2 prettyunits_1.1.1 tools_4.1.2
testthat_3.1.2 digest_0.6.29 [8] pkgbuild_1.3.1
pkgload_1.2.4 evaluate_0.15 memoise_2.0.1 lifecycle_1.0.1
tibble_3.1.6 pkgconfig_2.0.3 [15] rlang_1.0.2 DBI_1.1.2
cli_3.2.0 rstudioapi_0.13 curl_4.3.2 yaml_2.3.5
xfun_0.30 [22] fastmap_1.1.0 withr_2.5.0 knitr_1.38
desc_1.4.1 generics_0.1.2 vctrs_0.3.8 fs_1.5.2
[29] devtools_2.4.3 rprojroot_2.0.2 tidyselect_1.1.2 glue_1.6.2
R6_2.5.1 processx_3.5.2 fansi_1.0.2 [36]
rmarkdown_2.13 sessioninfo_1.2.2 purrr_0.3.4 callr_3.7.0
magrittr_2.0.2 usethis_2.1.5 ps_1.6.0 [43]
ellipsis_0.3.2 htmltools_0.5.2 assertthat_0.2.1 utf8_1.2.2
cachem_1.0.6 crayon_1.5.1 brio_1.1.3

blogdown: 'system3' is not an exported object from 'namespace:xfun'

On Windows 10, I am getting the following error with blogdown::new_site() function:
Hugo has been installed to "C:\Users\hp\AppData\Roaming\Hugo\0.89.4".
You are recommended to set options(blogdown.hugo.version = "0.89.4")
in the .Rprofile file in your website project. See the blogdown book
for more info on .Rprofile:
https://bookdown.org/yihui/blogdown/global-options.html
Error: 'system3' is not an exported object from 'namespace:xfun'
I'm wondering what am I missing here? Any hints.
sessionInfo()
R version 4.1.2 (2021-11-01)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19042)
Matrix products: default
locale:
[1] LC_COLLATE=English_United States.1252
[2] LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C
[5] LC_TIME=English_United States.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] xfun_0.28
loaded via a namespace (and not attached):
[1] compiler_4.1.2 tools_4.1.2 blogdown_1.6.5 pacman_0.5.1
I don't know how you managed to install the dev version of blogdown without installing the dev version of xfun at the same time, since the latter is required (as specified in DESCRIPTION). Per installation instruction in README, this is how you install the dev version of blogdown:
remotes::install_github('rstudio/blogdown')
And the dev version of xfun should be installed automatically (note that you will need RTools).
FYI I get the exact same error trying to following the TL;DR section of this blog and that is after explicitly updating the xfun package. Here is the entire code segment I am trying to run:
remotes::install_github("rstudio/blogdown")
usethis::create_project()
blogdown::new_site(theme = "wowchemy/starter-academic")
and here is the error I am getting:
09:14:26 > blogdown::new_site(theme = "wowchemy/starter-academic")
― Creating your new site
| Installing Hugo
The latest Hugo version is v0.90.1
trying URL 'https://github.com/gohugoio/hugo/releases/download/v0.90.1/hugo_extended_0.90.1_macOS-ARM64.tar.gz'
Content type 'application/octet-stream' length 16102460 bytes (15.4 MB)
==================================================
downloaded 15.4 MB
Hugo has been installed to "/Users/rogerbos/Library/Application Support/Hugo/0.90.1".
Error: 'system3' is not an exported object from 'namespace:xfun'
09:14:26 >
and here is my sessionInfo():
9:14:26 > sessionInfo()
R version 4.1.2 (2021-11-01)
Platform: aarch64-apple-darwin20 (64-bit)
Running under: macOS Monterey 12.0.1
Matrix products: default
LAPACK: /Library/Frameworks/R.framework/Versions/4.1-arm64/Resources/lib/libRlapack.dylib
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
attached base packages:
[1] datasets utils stats graphics grDevices methods base
other attached packages:
[1] alphavantager_0.1.2 googlesheets4_1.0.0 googledrive_2.0.0
[4] clipr_0.7.1 jsonlite_1.7.2 stringi_1.7.6
[7] dtplyr_1.1.0 data.table_1.14.2 dplyr_1.0.7
[10] plyr_1.8.6 testthat_3.1.0 lubridate_1.8.0
[13] timeDate_3043.102 sendmailR_1.2-1 rmarkdown_2.11
[16] devtools_2.4.2 usethis_2.1.3 xts_0.12.1
[19] zoo_1.8-9 MASS_7.3-54 fortunes_1.5-4
loaded via a namespace (and not attached):
[1] Rcpp_1.0.7 lattice_0.20-45 prettyunits_1.1.1
[4] ps_1.6.0 assertthat_0.2.1 rprojroot_2.0.2
[7] digest_0.6.29 utf8_1.2.2 R6_2.5.1
[10] cellranger_1.1.0 evaluate_0.14 blogdown_1.6.5
[13] httr_1.4.2 pillar_1.6.4 rlang_0.4.12
[16] curl_4.3.2 rstudioapi_0.13 callr_3.7.0
[19] desc_1.4.0 compiler_4.1.2 xfun_0.28
[22] pkgconfig_2.0.3 askpass_1.1 base64enc_0.1-3
[25] pkgbuild_1.2.0 htmltools_0.5.2 openssl_1.4.5
[28] tidyselect_1.1.1 tibble_3.1.5 bookdown_0.24
[31] fansi_0.5.0 crayon_1.4.2 withr_2.4.2
[34] rappdirs_0.3.3 grid_4.1.2 lifecycle_1.0.1
[37] DBI_1.1.1 magrittr_2.0.1 cli_3.1.0
[40] cachem_1.0.6 fs_1.5.0 remotes_2.4.1
[43] ellipsis_0.3.2 vctrs_0.3.8 generics_0.1.1
[46] tools_4.1.2 glue_1.5.1 purrr_0.3.4
[49] processx_3.5.2 pkgload_1.2.3 fastmap_1.1.0
[52] gargle_1.2.0 sessioninfo_1.2.1 memoise_2.0.0
[55] knitr_1.36

RStudio - Markdown Crash: Error in (function (srcref) : unimplemented type (29) in 'eval'

My RStudio crashed a number of times with the following error:
Error in (function (srcref) : unimplemented type (29) in 'eval'
The similarities where this has happened were:
I was working in a Markdown Notebook
I believe it was always when I selected the "Run all chunks above" command
I had run some code chunks in the current session before (so it wasn't upon starting work)
The error was always displayed just before the RStudio session aborted. I lose all my data and variables in the environment, but most of the code seems to be recoverable.
Anyone with an idea of what might cause this or how to deal with it?
Here my SessionInfo
R version 4.0.0 (2020-04-24)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 18363)
Matrix products: default
locale:
[1] LC_COLLATE=English_United Kingdom.1252 LC_CTYPE=English_United Kingdom.1252 LC_MONETARY=English_United Kingdom.1252
[4] LC_NUMERIC=C LC_TIME=English_United Kingdom.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] data.table_1.12.8 forcats_0.5.0 stringr_1.4.0 dplyr_0.8.5 purrr_0.3.4 readr_1.3.1
[7] tidyr_1.0.2 tibble_3.0.0 ggplot2_3.3.0 tidyverse_1.3.0
loaded via a namespace (and not attached):
[1] Rcpp_1.0.4.6 cellranger_1.1.0 pillar_1.4.3 compiler_4.0.0 dbplyr_1.4.3 tools_4.0.0 packrat_0.5.0
[8] lubridate_1.7.8 jsonlite_1.6.1 lifecycle_0.2.0 nlme_3.1-147 gtable_0.3.0 lattice_0.20-41 pkgconfig_2.0.3
[15] rlang_0.4.5 reprex_0.3.0 cli_2.0.2 DBI_1.1.0 rstudioapi_0.11 haven_2.2.0 xfun_0.13
[22] withr_2.2.0 xml2_1.3.1 httr_1.4.1 knitr_1.28 fs_1.4.1 hms_0.5.3 generics_0.0.2
[29] vctrs_0.2.4 grid_4.0.0 tidyselect_1.0.0 glue_1.4.0 R6_2.4.1 fansi_0.4.1 readxl_1.3.1
[36] modelr_0.1.6 magrittr_1.5 backports_1.1.6 scales_1.1.0 ellipsis_0.3.0 rvest_0.3.5 assertthat_0.2.1
[43] colorspace_1.4-1 stringi_1.4.6 munsell_0.5.0 broom_0.5.6 crayon_1.3.4
I sadly can't give you a reproducible example, but this is a screenshot of the last time it happened:
And the next time following a fairly simple ggplot command:
You might try updating Rstudio.
I had similar messages that started to occur after I updated to version 4.0.0 of R. These errors were occurring with code that presented no problems on previous versions of R. I could run the code line by line with Ctrl-Enter with no error, but running the whole chunk would be a problem.
The issue went away when I updated Rstudio from Version 1.1.463 to 1.2.5042.

error "object ‘coef.cv.glmnet’ is not exported by 'namespace:glmnet' " while loading Lime package in R -

I've successfully installed Lime (and glmnet) in R but when I try loading it i receive an error:
> require(lime)
Loading required package: lime
Error: package or namespace load failed for ‘lime’:
object ‘coef.cv.glmnet’ is not exported by 'namespace:glmnet'
Searched online and can't seem to find a solution for this.
This is my sessioninfo()
> sessionInfo()
R version 3.6.1 (2019-07-05)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 17763)
Matrix products: default
locale:
[1] LC_COLLATE=English_Australia.1252 LC_CTYPE=English_Australia.1252 LC_MONETARY=English_Australia.1252 LC_NUMERIC=C
[5] LC_TIME=English_Australia.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] glmnet_3.0 Matrix_1.2-17
loaded via a namespace (and not attached):
[1] Rcpp_1.0.3 rstudioapi_0.10 magrittr_1.5 tidyselect_0.2.5 munsell_0.5.0 colorspace_1.4-1 lattice_0.20-38 R6_2.4.0 rlang_0.4.1
[10] foreach_1.4.7 dplyr_0.8.3 tools_3.6.1 grid_3.6.1 gtable_0.3.0 iterators_1.0.12 lazyeval_0.2.2 assertthat_0.2.1 tibble_2.1.3
[19] crayon_1.3.4 purrr_0.3.3 ggplot2_3.2.1 codetools_0.2-16 shape_1.4.4 glue_1.3.1 compiler_3.6.1 pillar_1.4.2 scales_1.0.0
[28] pkgconfig_2.0.3
I've updated all my packages.
glmnet loads successfully
> library(glmnet)
Loaded glmnet 3.0
The recent major update of glmnet (which now does not export coef.cv.glmnet anymore) appears to have broken lime. You can see errors with the same cause in the CRAN tests. You can expect a fix by the package maintainer soon (or the package will be archived by CRAN). See also this bug report and the answer by the maintainer:
This is due to a recent breaking change in glmnet—lime will be updated soon to fix this

Why devtools::document fails with unclear C++ error message?

I have a vignette that I can build using devtools::build_vignettes() but when I try to build the source package (RStudio/Build/build source package) it fails when executing devtools::document(roclets=c('rd', 'collate', 'namespace', 'vignette')) with the following error message:
R(32119,0x7fff7437f000) malloc: *** error for object 0x7fff74dc0c30: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
Exited with status 6.
This package uses Rcpp but I am definitely not an expert in Cpp and don't understand at all what is going on. I can use the package locally with no troubles.
> sessionInfo()
R version 3.5.1 (2018-07-02)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: OS X El Capitan 10.11.6
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.5/Resources/lib/libRlapack.dylib
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] Rcpp_1.0.0 rstudioapi_0.8 knitr_1.20 magrittr_1.5 usethis_1.4.0 devtools_2.0.1
[7] pkgload_1.0.2 R6_2.3.0 rlang_0.3.0.1 tools_3.5.1 pkgbuild_1.0.2 sessioninfo_1.1.1
[13] cli_1.0.1 withr_2.1.2 htmltools_0.3.6 remotes_2.0.2 yaml_2.2.0 assertthat_0.2.0
[19] digest_0.6.18 rprojroot_1.3-2 crayon_1.3.4 processx_3.2.0 callr_3.0.0 clisymbols_1.2.0
[25] base64enc_0.1-3 fs_1.2.6 ps_1.2.1 evaluate_0.12 glue_1.3.0 memoise_1.1.0
[31] rmarkdown_1.10 compiler_3.5.1 desc_1.2.0 backports_1.1.2 prettyunits_1.0.2

Resources