Thanks, I realised afterwards that it was there, however I can't figure out how to fix the problem of it not finding packages (now it showed the 'maptools' package, but other times it happens with other packages).
I think that's my problem, because other apps I've been able to publish without problems.
Maybe the issue is how the packages are loaded? Try moving all the library() calls from outside your server function to the top of your file (into global scope).
For this warning:
Warning: namespace ‘ggplot2’ is not available and has been replaced
by .GlobalEnv when processing object ‘a’
I found this stackoverflow answer that has a proposed solution. Try:
rm(.a)
or if your environment is supposed to be empty when app is deployed:
rm(list = ls())
Then save your workspace. Restart R and redeploy your app. Although, it's not an error, but it's good practice to avoid warnings.
Thank you, but the error still there. I've tried put the library calls at the top of my file and into the server function, but nothing work. Now I don't have any warning.
This is the error now:
2022-07-06T17:39:11.069235+00:00 shinyapps[6602154]: Error in value[3L] : could not find function "read_excel"
This is the complete log:
2022-07-06T17:36:04.306270+00:00 shinyapps[6602154]: Calls: local ... tryCatch -> tryCatchList -> tryCatchOne -> <Anonymous>
2022-07-06T17:36:04.306332+00:00 shinyapps[6602154]: Execution halted
2022-07-06T17:36:04.306388+00:00 shinyapps[6602154]: Shiny application exiting ...
2022-07-06T17:39:11.068439+00:00 shinyapps[6602154]: Running on host: 7b16ad5ee748
2022-07-06T17:39:11.068496+00:00 shinyapps[6602154]: LANG: C.UTF-8
2022-07-06T17:39:11.068466+00:00 shinyapps[6602154]: Server version: 2022.05.0
2022-07-06T17:39:11.068541+00:00 shinyapps[6602154]: Working directory: /srv/connect/apps/Shiny_informe
2022-07-06T17:39:11.068595+00:00 shinyapps[6602154]: Running content using the current R environment
2022-07-06T17:39:11.068641+00:00 shinyapps[6602154]: R version: 4.1.1
2022-07-06T17:39:11.068737+00:00 shinyapps[6602154]: httpuv version: 1.6.1
2022-07-06T17:39:11.068851+00:00 shinyapps[6602154]: jsonlite version: 1.7.2
2022-07-06T17:39:11.068888+00:00 shinyapps[6602154]: RJSONIO version: (none)
2022-07-06T17:39:11.068691+00:00 shinyapps[6602154]: shiny version: 1.6.0
2022-07-06T17:39:11.069015+00:00 shinyapps[6602154]: Using pandoc: /opt/connect/ext/pandoc/2.16
2022-07-06T17:39:11.068776+00:00 shinyapps[6602154]: rmarkdown version: (none)
2022-07-06T17:39:11.068810+00:00 shinyapps[6602154]: knitr version: (none)
2022-07-06T17:39:11.069235+00:00 shinyapps[6602154]: Error in value[[3L]](cond) : could not find function "read_excel"
2022-07-06T17:39:11.069162+00:00 shinyapps[6602154]: Starting R with process ID: '28'
2022-07-06T17:39:11.068967+00:00 shinyapps[6602154]: reticulate version: (none)
2022-07-06T17:39:11.069200+00:00 shinyapps[6602154]: Shiny application starting ...
2022-07-06T17:39:11.069119+00:00 shinyapps[6602154]:
2022-07-06T17:39:11.069056+00:00 shinyapps[6602154]: Using jsonlite for JSON processing
2022-07-06T17:39:11.069293+00:00 shinyapps[6602154]: Calls: local ... tryCatch -> tryCatchList -> tryCatchOne -> <Anonymous>
2022-07-06T17:39:11.068919+00:00 shinyapps[6602154]: htmltools version: 0.5.1.1
2022-07-06T17:39:11.069376+00:00 shinyapps[6602154]: Shiny application exiting ...
2022-07-06T17:39:11.069332+00:00 shinyapps[6602154]: Execution halted
2022-07-06T17:39:14.339900+00:00 shinyapps[6602154]: Container event from container-6939179: stop
2022-07-06T17:39:16.135628+00:00 shinyapps[6602154]: Container event from container-6939187: start
2022-07-06T17:39:19.068310+00:00 shinyapps[6602154]: Running on host: 7b16ad5ee748
2022-07-06T17:39:19.068378+00:00 shinyapps[6602154]: Server version: 2022.05.0
2022-07-06T17:39:19.068479+00:00 shinyapps[6602154]: Working directory: /srv/connect/apps/Shiny_informe
2022-07-06T17:39:19.068422+00:00 shinyapps[6602154]: LANG: C.UTF-8
2022-07-06T17:39:19.068613+00:00 shinyapps[6602154]: shiny version: 1.6.0
2022-07-06T17:39:19.068696+00:00 shinyapps[6602154]: rmarkdown version: (none)
2022-07-06T17:39:19.068522+00:00 shinyapps[6602154]: Running content using the current R environment
2022-07-06T17:39:19.068569+00:00 shinyapps[6602154]: R version: 4.1.1
2022-07-06T17:39:19.068765+00:00 shinyapps[6602154]: jsonlite version: 1.7.2
2022-07-06T17:39:19.068815+00:00 shinyapps[6602154]: RJSONIO version: (none)
2022-07-06T17:39:19.068654+00:00 shinyapps[6602154]: httpuv version: 1.6.1
2022-07-06T17:39:19.068734+00:00 shinyapps[6602154]: knitr version: (none)
2022-07-06T17:39:19.068904+00:00 shinyapps[6602154]: reticulate version: (none)
2022-07-06T17:39:19.068862+00:00 shinyapps[6602154]: htmltools version: 0.5.1.1
2022-07-06T17:39:19.068946+00:00 shinyapps[6602154]: Using pandoc: /opt/connect/ext/pandoc/2.16
2022-07-06T17:39:19.069105+00:00 shinyapps[6602154]: Starting R with process ID: '44'
2022-07-06T17:39:19.068988+00:00 shinyapps[6602154]: Using jsonlite for JSON processing
2022-07-06T17:39:19.069058+00:00 shinyapps[6602154]:
2022-07-06T17:39:19.069147+00:00 shinyapps[6602154]: Shiny application starting ...
2022-07-06T17:39:19.069271+00:00 shinyapps[6602154]: Execution halted
2022-07-06T17:39:19.069191+00:00 shinyapps[6602154]: Error in value[[3L]](cond) : could not find function "read_excel"
2022-07-06T17:39:19.069234+00:00 shinyapps[6602154]: Calls: local ... tryCatch -> tryCatchList -> tryCatchOne -> <Anonymous>
2022-07-06T17:39:19.069307+00:00 shinyapps[6602154]: Shiny application exiting ...
Did you specify/edit your .libPaths at any point? Check by running .libPaths() command in R Studio console.
When using functions from the libraries explicitly state their scope. For example: readxl::read_excel(path = "yourPath")
instead of read_excel(path = "yourPath").
This tells it that the function read_excel is in the readxl package.
Make sure the excel file is also being deployed to shinyapps.io. You can place it in a 'data' subfolder of your project.
It would help if we could see your project code, even if not reprex, if possible.
EDIT: Also found this post with same issue, and potentially root cause is indeed the encoding as I see you use Spanish (has non-standard English characters?). Search for how to save your excel file with UTF-8 encoding. Then can also specify encoding in your read_excel function call: data <- xlsx::read.xlsx("file.xlsx", sheetIndex = 1, encoding="UTF-8")
If there's any non-standard characters in your R code also, do RStudio: File -> Save with encoding ->UTF-8
I finally published my app. I did it from another computer and when publishing it installed/updated "rsconnect" (I don't remember if it installed or updated it), which created a subfolder of rsconnect in my app folder, which wasn't there before.
During the installation all the packages needed to run my app were loaded.