The fs package provides a cross-platform, uniform interface to file system operations in R, built on the libuv C library that powers Node.js. It offers a consistent API for working with paths, files, directories, and links across different operating systems.
The package addresses key inconsistencies in base R’s file handling functions through full vectorization of all operations, predictable return values that always convey paths, explicit error handling instead of warnings with system-dependent codes, and UTF-8 encoding for all paths across platforms. It uses a consistent naming convention and returns “tidy” paths that always use forward slashes as delimiters, making file system operations more reliable and easier to debug. The package integrates well with tidyverse tools for tasks like filtering files by attributes, tabulating folder sizes, and reading multiple files into data frames.
Contributors#
Resources featuring fs#
Wes McKinney @ Posit | Data Science Hangout
We were recently joined by Wes McKinney, Principal Architect at Posit PBC to chat about advocating for the needs of the PyData ecosystem, his experience as a software entrepreneur and long-time developer of open source projects for data science and analytical computing, and building open source sustainability.
Speaker bio: Wes is an entrepreneur and open source software developer focusing on data science tools and analytical computing. He’s currently a Principal Architect at Posit PBC. Previously, Wes co-founded Voltron Data and created or co-created the pandas, Apache Arrow, and Ibis projects. He is a Member of The Apache Software Foundation and has published three editions of Python for Data Analysis.
Links mentioned: Python for Data Analysis: https://wesmckinney.com/book/ Wes McKinney Blog: https://wesmckinney.com/archives Automate the Boring Stuff with Python: https://automatetheboringstuff.com/ posit::conf(2024) call for talks: https://posit.co/blog/speak-at-posit-conf-2024/ Quarto: https://quarto.org/ This is Water: https://fs.blog/david-foster-wallace-this-is-water/ Questions about Posit Products: https://pos.it/chat-with-us
► Subscribe to Our Channel Here: https://bit.ly/2TzgcOu
Follow Us Here: Website: https://www.posit.co LinkedIn: https://www.linkedin.com/company/posit-software
To join future data science hangouts, add to your calendar here: pos.it/dsh (All are welcome! We’d love to see you!)
Thanks for hanging out with us!
Welcome to Quarto Workshop! | Led by Tom Mock, RStudio
Welcome to Quarto 2-hour Workshop | Led by Tom Mock, RStudio
Content website: https://jthomasmock.github.io/quarto-2hr-webinar/ FULL Workshop Materials (this was from a 2-day workshop): rstd.io/get-started-quarto Other upcoming live events: rstd.io/community-events
Double-check: Are you on the latest version of RStudio i.e. v2022.07.1 or later?
Packages used: tidyverse, gt, gtExtras, reactable, ggiraph, here, quarto, rmarkdown, gtsummary, palmerpenguins, fs, skimr
️ Pre-built RStudio Cloud with workshop materials already installed: https://rstudio.cloud/content/4332583
For follow-up questions, please use: community.rstudio.com/tag/quarto
Timestamps: 7:16 - What is Quarto? 8:28 - How does R Markdown work? 9:40: Quarto, more than just knitr 13:56 - Quarto can support htmlwidgets in R and Jupyter widgets for Python/Julia 14:18 - Native support for Observable Javascript 19:28 - Quarto in your own workspace (Jupyter Lab, VSCode, RStudio) 20:26 - RStudio Visual Editor mode 23:30 - VS Code YAML 26:02 - Quarto for collaboration 26:55 - How do you publish Quarto? (Quarto Pub, GitHub Pages, RStudio Connect, Netlify) 28:44 - What about Data Science at Work? 29:59 - Formats baked into Quarto (basic formats, beamer, ppt, html slides, advanced layout, cross references, websites, blogs, books, interactivity) 32:13 - What to do with my existing .Rmd or .ipynb? 33:16 - Why Quarto, instead of R Markdown? 40:50 - Text Formatting 41:30 - Headings 41:51 - Code (also merging R and Python in one document) 43:29 - What about the CLI? 44:55 - Navigating in the terminal 57:56 - PART 2: Authoring Quarto 1:00:22 - Output options 1:04:46 - Quarto workflow 1:12:06 - Quarto YAML intelligence 1:13:20 - Divs and Spans 1:22:13 - Figure layout 1:34:40 - Code chunk options 1:41:00 - Quarto and R Markdown (converting R Markdown to Quarto)
This 2-hour virtual session is designed for those who have no or little prior experience with R Markdown and who want to learn Quarto.
Want to get started with Quarto?
- Install RStudio v2022.07.1 from https://www.rstudio.com/products/rstudio/download/#download - this will come with a working version of Quarto!
- Webinar materials/slides: https://jthomasmock.github.io/quarto-2hr-webinar/
- Workshop materials on RStudio Cloud: https://rstudio.cloud/content/4332583
What is Quarto?
Quarto is the next generation of R Markdown for publishing, including dynamic and static documents and multi-lingual programming language support. With Quarto you can create documents, books, presentations, blogs or other online resources.
Should I take this?
As with all the community meetups, everyone is welcome. This will be especially interesting to you if you have experience programming in R and want to learn how to take advantage of Quarto for literate data science programming in academia, science, and industry.
This workshop will be appropriate for attendees who answer yes to these questions:
Have you programmed in R and want to better encapsulate your code, documentation, and outputs in a cohesive “data product”? Do you want to learn about the next generation of R Markdown for data science? Do you want to have a better interactive experience when writing technical or scientific documents with literate programming?
For more info on Quarto: quarto.org