class: title-slide, left, bottom, animated, fadeIn # Cách in cây thư mục ---- ## **Khóa học: Hướng dẫn sử dụng R để xử lý dữ liệu** ### Biên soạn: Duc Nguyen (Tự học R chấm com) ### Đăng ký: tuhocr.com@gmail.com - Website: www.tuhocr.com --- class: animated, fadeIn # Nhu cầu Khi bạn cần minh họa ý tưởng về các file và folder theo cấu trúc cây thư mục (directory tree) như vầy thì có các lựa chọn sau: 1. Dùng Command Prompt trong Windows 2. Dùng Terminal trong RStudio 3. Dùng package `fs` trong RStudio 4. Dùng extension [`file-tree-generator`](https://marketplace.visualstudio.com/items?itemName=Shinotatwu-DS.file-tree-generator) trong Visual Studio Code .pull-left[ ```r D:\garden> # In kiểu Unicode │ garden.Rproj # File │ diet_data.zip │ └───diet_data # Folder Andy.csv David.csv John.csv ``` ] .pull-right[ ```r D:\garden> # In kiểu ASCII | diet_data.zip | garden.Rproj | \---diet_data Andy.csv David.csv John.csv ``` ] --- class: animated, fadeIn # Cách 1: Command Prompt [https://tanduc307.github.io/tuhocr/cach-in-cay-thu-muc.htm](https://tanduc307.github.io/tuhocr/cach-in-cay-thu-muc.htm) --- class: animated, fadeIn # Cách 2: Terminal Trên phần Console của RStudio có thẻ Terminal. Click vào và thực hiện tương tự như cách 1. --- class: animated, fadeIn # Cách 3: Package `ls` `install.packages('ls')` cài đặt package vào `R` `library('fs')` load package `dir_tree("D:/garden")` in cây thư mục --- class: animated, fadeIn # Cách 4: Visual Studio Code Tham khảo hướng dẫn sử dụng [`file-tree-generator`](https://marketplace.visualstudio.com/items?itemName=Shinotatwu-DS.file-tree-generator)