DS4PS / cpp-526-spr-2021

Course shell for Foundations of Data Science I
https://ds4ps.org/cpp-526-spr-2021/
MIT License
1 stars 2 forks source link

Lab4 #10

Open allayebarou23 opened 3 years ago

allayebarou23 commented 3 years ago

When I try to run the selectInput chunk I get this error Error in selectInput(inputId = "my_team", label = "Select a team:", choices = c("New York Yankees", : could not find function "selectInput"

jamisoncrawford commented 3 years ago

This catches a lot of learners. Make sure library(shiny) is at the start of your script and - here's the catch - make sure "I" is capitalized and every other letter isn't. If R can't find that function, it's either not loaded or not capitalized properly (usually!).

sjone128 commented 3 years ago

@allayebarou23 I had the same error this morning. Once I added library(shiny) into the code chunk, it worked. Good luck!

allayebarou23 commented 3 years ago

@jamisoncrawford thank you. I was stuck on there for a while. It's working now.

ellihammons21 commented 3 years ago

I am having the same issue, but when I run library(shiny) in the code chunk I get this error message.

Error: package or namespace load failed for ‘shiny’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]): namespace ‘rlang’ 0.4.7 is already loaded, but >= 0.4.9 is required

I tried updating the 'rlang' package but it doesn't look like it updated to the correct version, and I am still getting the same error message.

jamisoncrawford commented 3 years ago

@ellihammons21 can you try to reinstall shiny with install.packages()? Keep us updated!

ellihammons21 commented 3 years ago

I tried to reinstall shiny with install.packages() and am still getting the same error.

Error: package or namespace load failed for ‘shiny’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]): namespace ‘rlang’ 0.4.7 is already loaded, but >= 0.4.9 is required

jamisoncrawford commented 3 years ago

This can be tough to diagnose. Please email me your .R file and I will have a look at it.

Also, what versions of R and RStudio are you using?

ellihammons21 commented 3 years ago

Ok, I will go ahead and email you the .r file. I am currently using R version 4.0.2 (2020-06-22). Thanks!

lecy commented 3 years ago

@ellihammons21 I am guessing you are trying to install the package in R Studio?

R Studio needs to load some packages in the background so it can lock files that you are trying to replace. I suspect that's what this error is:

namespace ‘rlang’ 0.4.7 is already loaded, but >= 0.4.9 is required

I would close down R Studio, open a basic R console, then try installing rlang. If that works install shiny then.

ellihammons21 commented 3 years ago

Success! I closed down RStudio and installed rlang and shiny in a basic r console. Now, when I opened RStudio and ran library(shiny) in the code chunk, it was able to run the code successfully.

Thanks to everyone!

jamisoncrawford commented 3 years ago

All thanks to @lecy! Good call!