# set the environment 
Packages <- c("dplyr", "tidyverse","treemap","RColorBrewer","highcharter","readr","plotly",'psych')

lapply(Packages, library, character.only = TRUE)
## 
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
## 
##     filter, lag
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union
## ── Attaching packages ─────────────────────────────────────── tidyverse 1.3.1 ──
## ✓ ggplot2 3.3.5     ✓ purrr   0.3.4
## ✓ tibble  3.1.2     ✓ stringr 1.4.0
## ✓ tidyr   1.1.3     ✓ forcats 0.5.1
## ✓ readr   1.4.0
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## x dplyr::filter() masks stats::filter()
## x dplyr::lag()    masks stats::lag()
## Registered S3 method overwritten by 'quantmod':
##   method            from
##   as.zoo.data.frame zoo
## Highcharts (www.highcharts.com) is a Highsoft software product which is
## not free for commercial and Governmental use
## 
## 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
## 
## Attaching package: 'psych'
## The following objects are masked from 'package:ggplot2':
## 
##     %+%, alpha
## [[1]]
## [1] "dplyr"     "stats"     "graphics"  "grDevices" "utils"     "datasets" 
## [7] "methods"   "base"     
## 
## [[2]]
##  [1] "forcats"   "stringr"   "purrr"     "readr"     "tidyr"     "tibble"   
##  [7] "ggplot2"   "tidyverse" "dplyr"     "stats"     "graphics"  "grDevices"
## [13] "utils"     "datasets"  "methods"   "base"     
## 
## [[3]]
##  [1] "treemap"   "forcats"   "stringr"   "purrr"     "readr"     "tidyr"    
##  [7] "tibble"    "ggplot2"   "tidyverse" "dplyr"     "stats"     "graphics" 
## [13] "grDevices" "utils"     "datasets"  "methods"   "base"     
## 
## [[4]]
##  [1] "RColorBrewer" "treemap"      "forcats"      "stringr"      "purrr"       
##  [6] "readr"        "tidyr"        "tibble"       "ggplot2"      "tidyverse"   
## [11] "dplyr"        "stats"        "graphics"     "grDevices"    "utils"       
## [16] "datasets"     "methods"      "base"        
## 
## [[5]]
##  [1] "highcharter"  "RColorBrewer" "treemap"      "forcats"      "stringr"     
##  [6] "purrr"        "readr"        "tidyr"        "tibble"       "ggplot2"     
## [11] "tidyverse"    "dplyr"        "stats"        "graphics"     "grDevices"   
## [16] "utils"        "datasets"     "methods"      "base"        
## 
## [[6]]
##  [1] "highcharter"  "RColorBrewer" "treemap"      "forcats"      "stringr"     
##  [6] "purrr"        "readr"        "tidyr"        "tibble"       "ggplot2"     
## [11] "tidyverse"    "dplyr"        "stats"        "graphics"     "grDevices"   
## [16] "utils"        "datasets"     "methods"      "base"        
## 
## [[7]]
##  [1] "plotly"       "highcharter"  "RColorBrewer" "treemap"      "forcats"     
##  [6] "stringr"      "purrr"        "readr"        "tidyr"        "tibble"      
## [11] "ggplot2"      "tidyverse"    "dplyr"        "stats"        "graphics"    
## [16] "grDevices"    "utils"        "datasets"     "methods"      "base"        
## 
## [[8]]
##  [1] "psych"        "plotly"       "highcharter"  "RColorBrewer" "treemap"     
##  [6] "forcats"      "stringr"      "purrr"        "readr"        "tidyr"       
## [11] "tibble"       "ggplot2"      "tidyverse"    "dplyr"        "stats"       
## [16] "graphics"     "grDevices"    "utils"        "datasets"     "methods"     
## [21] "base"
# Create data
activities <- c(rep("Sleeping",2),rep("Learning",5),rep("eating",2),"video game",rep('girlfriend',2),'cleaning','smoking')
detail<-c('tomorrow','today',"inst327","inst362",'inst352','inst354','inst462','lunch','dinner','ARAM','video-call','phone-call','cleaning','smoking')
time <- c(6,6,2,2,2,2,2,0.3,0.5,4,5,2,0.3,0.1)
data <- data.frame(activities,detail,time)
treemap(data,
            index=c("activities","detail"),
            vSize="time",
            type="index",palette="RdYlBu",title  = 'Schedule')