Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

could not find function "navbar_proj" #124

Open
ericpgreen opened this issue Feb 14, 2020 · 13 comments
Open

could not find function "navbar_proj" #124

ericpgreen opened this issue Feb 14, 2020 · 13 comments

Comments

@ericpgreen
Copy link

I am attempting to deploy to shinyapps.io. When I source inst/app/ui.R, I get the error could not find function "navbar_proj"

Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 18.04.2 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/openblas/libblas.so.3
LAPACK: /usr/lib/x86_64-linux-gnu/libopenblasp-r0.2.20.so

locale:
 [1] LC_CTYPE=C.UTF-8       LC_NUMERIC=C           LC_TIME=C.UTF-8
 [4] LC_COLLATE=C.UTF-8     LC_MONETARY=C.UTF-8    LC_MESSAGES=C.UTF-8
 [7] LC_PAPER=C.UTF-8       LC_NAME=C              LC_ADDRESS=C
[10] LC_TELEPHONE=C         LC_MEASUREMENT=C.UTF-8 LC_IDENTIFICATION=C

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

other attached packages:
 [1] radiant_1.3.1              radiant.multivariate_1.3.2
 [3] radiant.model_1.3.3        radiant.basics_1.3.0
 [5] radiant.design_1.3.0       mvtnorm_1.0-12
 [7] radiant.data_1.3.3         dplyr_0.8.3
 [9] tidyr_1.0.0                lubridate_1.7.4
[11] ggplot2_3.2.1              magrittr_1.5
@ericpgreen
Copy link
Author

I tried a different approach without source() whereby I opened ui.R and hit "Run App". The app comes up, but when I try to republish to a new destination I get an error that "Paths should be to files within the project directory", with a reference to line 5 in global.R.

I created a project where the root is radiant/inst/app, so this is also the root directory.

@vnijs
Copy link
Contributor

vnijs commented Feb 16, 2020

If you clone this repo and re-create the key settings shown in the screenshot below you should be able to host an instance of radiant on shinyapps.io. FYI I just verified this is still working by updating to: https://vnijs.shinyapps.io/radiant

image

@ericpgreen
Copy link
Author

Thanks, @vnijs. I updated the files and tried to deploy again. No luck though. I got the error about the file paths again.

I tried with two different root directories: my equivalent of your GitHub/ and app. Both times I get the error message referencing line 5 of global.R.

To deploy, I'm running the app (works fine) and then hitting republish with my account details. Am I doing something wrong with the working directory or publishing?

@vnijs
Copy link
Contributor

vnijs commented Feb 16, 2020

When I publish to shinyapps.io I open the radiant Rstudio project file and don't mess with the working directory. I'd recommend you create a new clone of the original repo and trying again. If that works, you can try to change things as you wish

@vnijs
Copy link
Contributor

vnijs commented Feb 17, 2020

@ericpgreen I just noticed you are an educator. If you are considering using radiant for a class I'd recommend either (1) having students install on their laptops (see link below), (2) using Rstudio server, or (3) using Rstudio Cloud.

Most instructors using radiant that I know of have students install radiant on laptops. We have done this a lot by now and so the install instructions (linked below), including the all-in-one-installer for windows, work quite smoothly. On a class of 100 there are usually no more than 2-3 that get stuck on something. Let me know if you have any more questions.

https://radiant-rstats.github.io/docs/install.html

@ericpgreen
Copy link
Author

Thanks, @vnijs. I cloned the repo again and used the existing .Rproj file (which I missed previously), but I still got the same error when I deployed (app loads fine locally).

Screenshot 2020-02-17 07 38 17

It did work when I changed line 5 in global.R from file.exists("../../inst") to file.exists("../inst") (again I'm starting from the included .Rproj). So this gets me around the initial problem.

However, I'm getting a deploy error:

Error: Unhandled Exception: Child Task 693233796 failed: Error building image: Error fetching DiagrammeR (1.0.6) source. unable to satisfy package: DiagrammeR (1.0.6)

Ever experience this? I've contacted shinyapps.io support.

@vnijs
Copy link
Contributor

vnijs commented Feb 17, 2020

The latest release of DiagrammeR had a breaking change so please use the below on your local system before deploying to the shinyapps.io. This won't be necessary anymore once the fixed version of DiagrammeR is on CRAN

remotes::install_github("vnijs/DiagrammeR")

@ericpgreen
Copy link
Author

Thanks, @vnijs. That worked.

In summary, I learned to "run app" rather than source(), used the default project but for whatever reason needed to change the path in line 5 of global.R from file.exists("../../inst") to file.exists("../inst"), and updated DiagrammeR via remotes::install_github("vnijs/DiagrammeR").

Excited to explore.

@vnijs
Copy link
Contributor

vnijs commented Feb 17, 2020

Thanks for the update @ericpgreen! I don't think you actually need either "run app" or "source". When I open ui.R in Rstudio, it already shows the button to (re) publish. I also just pushed an update to global.R that I expect will resolve the need to edit global.R. If you could do a "git pull" on the repo and try to republish to shinyapps.io when you have a moment that would be great.

BTW Did you run the "for.shinyapps.io.R" file before publishing?

image

@ericpgreen
Copy link
Author

Good tip, thanks. I've mostly worked with flexdashboard before this, so helpful to know how to re-publish.

I cloned the repo again, but I got the same path error so I had to edit the global.R file again.

I did run for.shinyapps.io.R the very first time.

@vnijs
Copy link
Contributor

vnijs commented Feb 18, 2020

Hmmm. I'll try this from another machine and see what I can do about the global.R issue. Thanks for reporting

@ericpgreen
Copy link
Author

Really great work with radiant. It's impressive.

@vnijs
Copy link
Contributor

vnijs commented Feb 18, 2020

Thanks :) Are you thinking of using Radiant for a class?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants