Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Suddenly I get "Error : $ operator is invalid for atomic vectors"

I've been developing a shiny app with no issues. Then suddenly when I try to run it I get the following error:

Error : $ operator is invalid for atomic vectors
Warning: Error in $: $ operator is invalid for atomic vectors
Stack trace (innermost first):
68: tag
67: tags$a
66: tag
65: tags$li
64: FUN
63: lapply
62: buildTabset
61: tabsetPanel
60: tag
59: tags$div
58: div
57: tabPanel
56: tabsetPanel
55: tag
54: tags$div
53: div
52: fluidRow
51: tag
50: tags$div
49: div
48: hidden
47: tag
46: tags$div
45: div
44: tagList
43: attachDependencies
42: bootstrapPage
41: fluidPage
 1: runApp
Error : $ operator is invalid for atomic vectors

However, there's no indication of where the error is occurring as it doesn't specify a variable. Does anyone know what would cause such an error? My app has 1000s of lines of code so it's not practical to share it here.

like image 338
Geoff Avatar asked Aug 14 '17 18:08

Geoff


People also ask

What does error operator is invalid for atomic vectors mean?

The error that one may face in R is: $ operator is invalid for atomic vectors. Such an error is produced by the R compiler when we try to get an element of an atomic vector by using the $ operator. An atomic vector is simply a 1-dimensional object containing data created with the help of c() and vector() functions.


1 Answers

I do not have enough reputation to comment a comment so forgive me making an answer. This comment by Goeff solved my identical error.

Thanks Geovany. I managed to fix it by systematically commenting out sections of the UI script. What fixed it for me was adding an absent id ="abcd" to a tabsetPanel. I guess there's indication in the StackTrace. Thanks for for input though. – Geoff Aug 20 at 15:58

I also had tabsetPanels without the addition of "id =", I had a name though like

tabsetPanel( "abcd",...) yet it became non functional after updating shiny and r-Studio.

With tabsetPanel(id = "abcd,...) it works now.

Thanks to all!

like image 148
Sebastian Bloy Avatar answered Sep 29 '22 08:09

Sebastian Bloy