1

I'm trying to implement a shinyTree that has a default selected value. Does anybody know if that is possibly?

I couldn't find anything in the documentation or the examples that came with the package.

Thanks for all the help.

hjonas
  • 141
  • 10

1 Answers1

2

Set the 'stselected' attribute of your desired nodes to TRUE

Example:

output$tree <- renderTree({
   sss=list('Nodes' = list('Node1' = '1', 'Node2' = '2'))
   attr(sss[[1]][['Node1']],"stselected")=TRUE # <---
   attr(sss[[1]],"stopened")=TRUE
   sss
})
Victor Burnett
  • 588
  • 6
  • 10