library(DT)
## Warning: package 'DT' was built under R version 4.3.3
library(plotly)
## Warning: package 'plotly' was built under R version 4.3.3
## Loading required package: ggplot2
## Warning: package 'ggplot2' was built under R version 4.3.3
## 
## Attaching package: 'plotly'
## The following object is masked from 'package:ggplot2':
## 
##     last_plot
## The following object is masked from 'package:stats':
## 
##     filter
## The following object is masked from 'package:graphics':
## 
##     layout
library(crosstalk)
## Warning: package 'crosstalk' was built under R version 4.3.3
library(carData)
## Warning: package 'carData' was built under R version 4.3.3
#dataset carData::UN pomocou interaktívnej tabuľky. Zapnite jej filter stĺpcov, nastavte východzí počet 15 riadkov na stranu a pridajte názov (caption).
dat<-SharedData$new(carData::UN)

  p<-datatable(dat,options = list(pageLength=15))
  
#bodový graf závislosti medzi HDP a priemernou dĺžkou života s farebným odlíšením skupiny krajín
  
grap<-plot_ly(data = dat,x = ~fertility, y = ~lifeExpF, color = ~group, size = ~pctUrban)

#interaktívne filtračné prvky

f1<-filter_checkbox("1","groupe",dat,~group)
 
f2<-filter_slider("2","lifeExpF",dat,~lifeExpF)

f3<-filter_select("3","region",dat, ~region)

bscols(p,grap,f1,f2,f3)
## No trace type specified:
##   Based on info supplied, a 'scatter' trace seems appropriate.
##   Read more about this trace type -> https://plotly.com/r/reference/#scatter
## No scatter mode specifed:
##   Setting the mode to markers
##   Read more about this attribute -> https://plotly.com/r/reference/#scatter-mode
## Warning: Ignoring 14 observations
## Warning: `line.width` does not currently support multiple values.

## Warning: `line.width` does not currently support multiple values.

## Warning: `line.width` does not currently support multiple values.