{"id":8494,"date":"2019-01-25T02:54:05","date_gmt":"2019-01-25T00:54:05","guid":{"rendered":"https:\/\/www.datanovia.com\/en\/?p=8494"},"modified":"2019-12-25T10:40:20","modified_gmt":"2019-12-25T08:40:20","slug":"how-to-easily-manipulate-files-and-directories-in-r","status":"publish","type":"post","link":"https:\/\/www.datanovia.com\/en\/blog\/how-to-easily-manipulate-files-and-directories-in-r\/","title":{"rendered":"How to Easily Manipulate Files and Directories in R"},"content":{"rendered":"<div id=\"rdoc\">\n<p>This article presents the <strong>fs<\/strong> R package, which provides a cross-platform, uniform interface to file system operations.<\/p>\n<p><strong>fs<\/strong> functions are divided into four main categories:<\/p>\n<ul>\n<li><code>path_<\/code> for manipulating and constructing paths<\/li>\n<li><code>file_<\/code> for files<\/li>\n<li><code>dir_<\/code> for directories<\/li>\n<li><code>link_<\/code> for links<\/li>\n<\/ul>\n<p>Contents:<\/p>\n<div id=\"TOC\">\n<ul>\n<li><a href=\"#prerequistes\">Prerequistes<\/a><\/li>\n<li><a href=\"#some-key-r-functions\">Some Key R functions<\/a><\/li>\n<li><a href=\"#basic-usage\">Basic usage<\/a><\/li>\n<li><a href=\"#filter-files\">Filter files<\/a><\/li>\n<li><a href=\"#read-a-collection-of-files-into-one-data-frame\">Read a collection of files into one data frame<\/a><\/li>\n<\/ul>\n<\/div>\n<div id=\"prerequistes\" class=\"section level2\">\n<h2>Prerequistes<\/h2>\n<p>Install the package from CRAN (<code>install.packages(\"fs\")<\/code>) or from GitHub (<code>devtools::install_github(\"r-lib\/fs\")<\/code>)<\/p>\n<p>Load required packages:<\/p>\n<pre class=\"r\"><code>library(\"fs\")  # File manipulations\r\nlibrary(tidyverse)  # Data manipulation<\/code><\/pre>\n<\/div>\n<div id=\"some-key-r-functions\" class=\"section level2\">\n<h2>Some Key R functions<\/h2>\n<p><strong>File manipulation<\/strong>:<\/p>\n<ul>\n<li><code>file_copy(), dir_copy(), link_copy()<\/code>: Copy files, directories or links<\/li>\n<li><code>file_create(), dir_create(), link_create()<\/code>: Create files, directories, or links<\/li>\n<li><code>file_delete(), dir_delete(), link_delete()<\/code>: Delete files, directories, or links<\/li>\n<li><code>file_access(), file_exists(), dir_exists(), link_exists()<\/code>: Query for existence and access permissions<\/li>\n<li><code>file_chmod()<\/code>: Change file permissions<\/li>\n<li><code>file_chown()<\/code>: Change owner or group of a file<\/li>\n<li><code>file_info()<\/code>: Query file metadata<\/li>\n<li><code>file_move()<\/code>: Move or rename files<\/li>\n<\/ul>\n<p><strong>Path manipulation<\/strong>:<\/p>\n<ul>\n<li><code>path(), path_wd()<\/code>: Construct path to a file or directory<\/li>\n<li><code>file_temp(), path_temp()<\/code>: Create names for temporary files<\/li>\n<li><code>path_expand(), path_expand_r(), path_home(), path_home_r()<\/code>: Finding the User Home Directory<\/li>\n<li><code>path_file() path_dir() path_ext() path_ext_remove() path_ext_set()<\/code>: Manipulate file paths\n<ul>\n<li>path_file() returns the filename portion of the path,<\/li>\n<li>path_dir() returns the directory portion,<\/li>\n<li>path_ext() returns the last extension (if any) for a path,<\/li>\n<li>path_ext_remove() removes the last extension and returns the rest of the path,<\/li>\n<li>path_ext_set() replaces the extension with a new extension. If there is no existing extension the new extension is appended.<\/li>\n<\/ul>\n<\/li>\n<li><code>path_filter()<\/code>: Filter paths<\/li>\n<li><code>path_real() path_split() path_join() path_abs() path_norm() path_rel() path_common() path_has_parent()<\/code>: Path computations\n<ul>\n<li>path_real: returns the canonical path<\/li>\n<li>path_split: splits paths into parts<\/li>\n<li>path_abs: returns a normalized, absolute version of a path<\/li>\n<li>path_norm: eliminates . references and rationalizes up-level .. references, so A\/.\/B and A\/foo\/..\/B both become A\/B, but ..\/B is not changed. If one of the paths is a symbolic link, this may change the meaning of the path, so consider using path_real() instead.<\/li>\n<li>path_common: finds the common parts of two (or more) paths.<\/li>\n<li>path_has_parent: determine if a path has a given parent.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><strong>Helpers<\/strong>:<\/p>\n<ul>\n<li><code>is_file(), is_dir(), is_link()<\/code>: Functions to test for file types<\/li>\n<\/ul>\n<\/div>\n<div id=\"basic-usage\" class=\"section level2\">\n<h2>Basic usage<\/h2>\n<ul>\n<li>List the files in a directory\/folder<\/li>\n<li>Create and delete files\/directory<\/li>\n<\/ul>\n<pre class=\"r\"><code># Construct a path to a file with `path()`\r\npath(\"foo\", \"bar\", letters[1:3], ext = \"txt\")<\/code><\/pre>\n<pre><code>## foo\/bar\/a.txt foo\/bar\/b.txt foo\/bar\/c.txt<\/code><\/pre>\n<pre class=\"r\"><code># list files in the current directory\r\ndir_ls()<\/code><\/pre>\n<pre><code>## 002-create-icon.html\r\n## 003-r-histogram-example.html\r\n## _output.yaml\r\n## _settings.R\r\n## _settings.Rmd\r\n## book.bib\r\n## correlation-matrix-analysis-in-r-using-corrr.html\r\n## correlation-network-using-corrr.html\r\n## figures\r\n## file-and-directory-manipulation.Rmd\r\n## gganimate.html\r\n## gghighlight.html\r\n## include\r\n## interactive-data-summary.html\r\n## libs\r\n## mathjax.Rmd\r\n## packages.bib\r\n## plot-all-variables-in-a-dataset.html\r\n## plot-one-variable-against-multiples-others.html\r\n## wp-content<\/code><\/pre>\n<pre class=\"r\"><code># create a new directory\r\ntmp &lt;- dir_create(file_temp())\r\ntmp<\/code><\/pre>\n<pre><code>## \/var\/folders\/xm\/8p6yj4bj6s57n4v_51714lwm0000gp\/T\/Rtmp6lCt2d\/filed958126c105c<\/code><\/pre>\n<pre class=\"r\"><code># create new files in that directory\r\nfile_create(path(tmp, \"my-file.txt\"))\r\ndir_ls(tmp)<\/code><\/pre>\n<pre><code>## \/var\/folders\/xm\/8p6yj4bj6s57n4v_51714lwm0000gp\/T\/Rtmp6lCt2d\/filed958126c105c\/my-file.txt<\/code><\/pre>\n<pre class=\"r\"><code># remove files from the directory\r\nfile_delete(path(tmp, \"my-file.txt\"))\r\ndir_ls(tmp)<\/code><\/pre>\n<pre><code>## character(0)<\/code><\/pre>\n<pre class=\"r\"><code># remove the directory\r\ndir_delete(tmp)<\/code><\/pre>\n<\/div>\n<div id=\"filter-files\" class=\"section level2\">\n<h2>Filter files<\/h2>\n<p>Filter files by type, permission and size<\/p>\n<pre class=\"r\"><code>dir_info(path = \".\", recursive = FALSE) %&gt;%\r\n  filter(type == \"file\", permissions == \"u+r\", size &gt; \"10KB\") %&gt;%\r\n  arrange(desc(size)) %&gt;%\r\n  select(path, permissions, size, modification_time)<\/code><\/pre>\n<pre><code>## # A tibble: 2 x 4\r\n##   path                                              permissions  size\r\n##   &lt;fs::path&gt;                                        &lt;fs::perms&gt; &lt;fs:&gt;\r\n## 1 correlation-matrix-analysis-in-r-using-corrr.html rw-r--r--   20.3K\r\n## 2 gganimate.html                                    rw-r--r--   15.1K\r\n## # \u2026 with 1 more variable: modification_time &lt;dttm&gt;<\/code><\/pre>\n<p>Tabulate and display folder size.<\/p>\n<pre class=\"r\"><code>dir_info(path = \".\", recursive = TRUE) %&gt;%\r\n  group_by(directory = path_dir(path)) %&gt;%\r\n  tally(wt = size, sort = TRUE)<\/code><\/pre>\n<pre><code>## # A tibble: 37 x 2\r\n##   directory                                                    n\r\n##   &lt;fs::path&gt;                                         &lt;fs::bytes&gt;\r\n## 1 https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/dn-tutorials\/r-tutorial\/images       11.76M\r\n## 2 https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/dn-tutorials\/r-tutorial\/figures       2.36M\r\n## 3 libs\/bootstrap-3.3.5\/css                                 2.31M\r\n## 4 libs\/plotlyjs-1.16.3                                     1.66M\r\n## 5 libs\/bootstrap-3.3.5\/css\/fonts                         953.23K\r\n## 6 libs\/font-awesome-4.1.0\/fonts                          611.77K\r\n## # \u2026 with 31 more rows<\/code><\/pre>\n<\/div>\n<div id=\"read-a-collection-of-files-into-one-data-frame\" class=\"section level2\">\n<h2>Read a collection of files into one data frame<\/h2>\n<p><code>dir_ls()<\/code> returns a named vector, so it can be used directly with <code>purrr::map_df(.id)<\/code>.<\/p>\n<pre class=\"r\"><code># Create separate files for each species\r\niris %&gt;%\r\n  split(.$Species) %&gt;%\r\n  map(select, -Species) %&gt;%\r\n  iwalk(~ write_tsv(.x, paste0(.y, \".tsv\")))\r\n  \r\n# Show the files\r\niris_files &lt;- dir_ls(glob = \"*.tsv\")\r\niris_files<\/code><\/pre>\n<pre><code>## setosa.tsv     versicolor.tsv virginica.tsv<\/code><\/pre>\n<pre class=\"r\"><code># Read the data into a single table, including the filenames\r\niris_files %&gt;%\r\n  map_df(read_tsv, .id = \"file\", col_types = cols(), n_max = 2)<\/code><\/pre>\n<pre><code>## # A tibble: 6 x 5\r\n##   file           Sepal.Length Sepal.Width Petal.Length Petal.Width\r\n##   &lt;chr&gt;                 &lt;dbl&gt;       &lt;dbl&gt;        &lt;dbl&gt;       &lt;dbl&gt;\r\n## 1 setosa.tsv              5.1         3.5          1.4         0.2\r\n## 2 setosa.tsv              4.9         3            1.4         0.2\r\n## 3 versicolor.tsv          7           3.2          4.7         1.4\r\n## 4 versicolor.tsv          6.4         3.2          4.5         1.5\r\n## 5 virginica.tsv           6.3         3.3          6           2.5\r\n## 6 virginica.tsv           5.8         2.7          5.1         1.9<\/code><\/pre>\n<pre class=\"r\"><code>file_delete(iris_files)<\/code><\/pre>\n<\/div>\n<\/div>\n<p><!--end rdoc--><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This article presents the fs R package, which provides a cross-platform, uniform interface to file system operations. fs functions are divided into four main categories: path_ for manipulating and constructing [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":8001,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"rating_form_position":"","rating_results_position":"","mr_structured_data_type":"","footnotes":""},"categories":[138],"tags":[],"class_list":["post-8494","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-r-programming"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to Easily Manipulate Files and Directories in R - Datanovia<\/title>\n<meta name=\"description\" content=\"This article presents the fs R package, which provides a cross-platform, uniform interface to file system operations.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.datanovia.com\/en\/blog\/how-to-easily-manipulate-files-and-directories-in-r\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Easily Manipulate Files and Directories in R - Datanovia\" \/>\n<meta property=\"og:description\" content=\"This article presents the fs R package, which provides a cross-platform, uniform interface to file system operations.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.datanovia.com\/en\/blog\/how-to-easily-manipulate-files-and-directories-in-r\/\" \/>\n<meta property=\"og:site_name\" content=\"Datanovia\" \/>\n<meta property=\"article:published_time\" content=\"2019-01-25T00:54:05+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-12-25T08:40:20+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/2018\/10\/IMG_4623.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1024\" \/>\n\t<meta property=\"og:image:height\" content=\"512\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Alboukadel\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Alboukadel\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.datanovia.com\/en\/blog\/how-to-easily-manipulate-files-and-directories-in-r\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.datanovia.com\/en\/blog\/how-to-easily-manipulate-files-and-directories-in-r\/\"},\"author\":{\"name\":\"Alboukadel\",\"@id\":\"https:\/\/www.datanovia.com\/en\/#\/schema\/person\/7767cf2bd5c91a1610c6eb53a0ff069e\"},\"headline\":\"How to Easily Manipulate Files and Directories in R\",\"datePublished\":\"2019-01-25T00:54:05+00:00\",\"dateModified\":\"2019-12-25T08:40:20+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.datanovia.com\/en\/blog\/how-to-easily-manipulate-files-and-directories-in-r\/\"},\"wordCount\":353,\"commentCount\":1,\"publisher\":{\"@id\":\"https:\/\/www.datanovia.com\/en\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.datanovia.com\/en\/blog\/how-to-easily-manipulate-files-and-directories-in-r\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/2018\/10\/IMG_4623.jpg\",\"articleSection\":[\"R Programming\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.datanovia.com\/en\/blog\/how-to-easily-manipulate-files-and-directories-in-r\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.datanovia.com\/en\/blog\/how-to-easily-manipulate-files-and-directories-in-r\/\",\"url\":\"https:\/\/www.datanovia.com\/en\/blog\/how-to-easily-manipulate-files-and-directories-in-r\/\",\"name\":\"How to Easily Manipulate Files and Directories in R - Datanovia\",\"isPartOf\":{\"@id\":\"https:\/\/www.datanovia.com\/en\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.datanovia.com\/en\/blog\/how-to-easily-manipulate-files-and-directories-in-r\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.datanovia.com\/en\/blog\/how-to-easily-manipulate-files-and-directories-in-r\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/2018\/10\/IMG_4623.jpg\",\"datePublished\":\"2019-01-25T00:54:05+00:00\",\"dateModified\":\"2019-12-25T08:40:20+00:00\",\"description\":\"This article presents the fs R package, which provides a cross-platform, uniform interface to file system operations.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.datanovia.com\/en\/blog\/how-to-easily-manipulate-files-and-directories-in-r\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.datanovia.com\/en\/blog\/how-to-easily-manipulate-files-and-directories-in-r\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.datanovia.com\/en\/blog\/how-to-easily-manipulate-files-and-directories-in-r\/#primaryimage\",\"url\":\"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/2018\/10\/IMG_4623.jpg\",\"contentUrl\":\"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/2018\/10\/IMG_4623.jpg\",\"width\":1024,\"height\":512},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.datanovia.com\/en\/blog\/how-to-easily-manipulate-files-and-directories-in-r\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.datanovia.com\/en\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Easily Manipulate Files and Directories in R\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.datanovia.com\/en\/#website\",\"url\":\"https:\/\/www.datanovia.com\/en\/\",\"name\":\"Datanovia\",\"description\":\"Data Mining and Statistics for Decision Support\",\"publisher\":{\"@id\":\"https:\/\/www.datanovia.com\/en\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.datanovia.com\/en\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.datanovia.com\/en\/#organization\",\"name\":\"Datanovia\",\"url\":\"https:\/\/www.datanovia.com\/en\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.datanovia.com\/en\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/2018\/09\/datanovia-logo.png\",\"contentUrl\":\"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/2018\/09\/datanovia-logo.png\",\"width\":98,\"height\":99,\"caption\":\"Datanovia\"},\"image\":{\"@id\":\"https:\/\/www.datanovia.com\/en\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.datanovia.com\/en\/#\/schema\/person\/7767cf2bd5c91a1610c6eb53a0ff069e\",\"name\":\"Alboukadel\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.datanovia.com\/en\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/ed3108646c5c7c3d188324ab972f96ad7d9975b41b94014d7f68257791be395a?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/ed3108646c5c7c3d188324ab972f96ad7d9975b41b94014d7f68257791be395a?s=96&d=mm&r=g\",\"caption\":\"Alboukadel\"},\"url\":\"https:\/\/www.datanovia.com\/en\/blog\/author\/kassambara\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Easily Manipulate Files and Directories in R - Datanovia","description":"This article presents the fs R package, which provides a cross-platform, uniform interface to file system operations.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.datanovia.com\/en\/blog\/how-to-easily-manipulate-files-and-directories-in-r\/","og_locale":"en_US","og_type":"article","og_title":"How to Easily Manipulate Files and Directories in R - Datanovia","og_description":"This article presents the fs R package, which provides a cross-platform, uniform interface to file system operations.","og_url":"https:\/\/www.datanovia.com\/en\/blog\/how-to-easily-manipulate-files-and-directories-in-r\/","og_site_name":"Datanovia","article_published_time":"2019-01-25T00:54:05+00:00","article_modified_time":"2019-12-25T08:40:20+00:00","og_image":[{"width":1024,"height":512,"url":"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/2018\/10\/IMG_4623.jpg","type":"image\/jpeg"}],"author":"Alboukadel","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Alboukadel","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.datanovia.com\/en\/blog\/how-to-easily-manipulate-files-and-directories-in-r\/#article","isPartOf":{"@id":"https:\/\/www.datanovia.com\/en\/blog\/how-to-easily-manipulate-files-and-directories-in-r\/"},"author":{"name":"Alboukadel","@id":"https:\/\/www.datanovia.com\/en\/#\/schema\/person\/7767cf2bd5c91a1610c6eb53a0ff069e"},"headline":"How to Easily Manipulate Files and Directories in R","datePublished":"2019-01-25T00:54:05+00:00","dateModified":"2019-12-25T08:40:20+00:00","mainEntityOfPage":{"@id":"https:\/\/www.datanovia.com\/en\/blog\/how-to-easily-manipulate-files-and-directories-in-r\/"},"wordCount":353,"commentCount":1,"publisher":{"@id":"https:\/\/www.datanovia.com\/en\/#organization"},"image":{"@id":"https:\/\/www.datanovia.com\/en\/blog\/how-to-easily-manipulate-files-and-directories-in-r\/#primaryimage"},"thumbnailUrl":"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/2018\/10\/IMG_4623.jpg","articleSection":["R Programming"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.datanovia.com\/en\/blog\/how-to-easily-manipulate-files-and-directories-in-r\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.datanovia.com\/en\/blog\/how-to-easily-manipulate-files-and-directories-in-r\/","url":"https:\/\/www.datanovia.com\/en\/blog\/how-to-easily-manipulate-files-and-directories-in-r\/","name":"How to Easily Manipulate Files and Directories in R - Datanovia","isPartOf":{"@id":"https:\/\/www.datanovia.com\/en\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.datanovia.com\/en\/blog\/how-to-easily-manipulate-files-and-directories-in-r\/#primaryimage"},"image":{"@id":"https:\/\/www.datanovia.com\/en\/blog\/how-to-easily-manipulate-files-and-directories-in-r\/#primaryimage"},"thumbnailUrl":"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/2018\/10\/IMG_4623.jpg","datePublished":"2019-01-25T00:54:05+00:00","dateModified":"2019-12-25T08:40:20+00:00","description":"This article presents the fs R package, which provides a cross-platform, uniform interface to file system operations.","breadcrumb":{"@id":"https:\/\/www.datanovia.com\/en\/blog\/how-to-easily-manipulate-files-and-directories-in-r\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.datanovia.com\/en\/blog\/how-to-easily-manipulate-files-and-directories-in-r\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.datanovia.com\/en\/blog\/how-to-easily-manipulate-files-and-directories-in-r\/#primaryimage","url":"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/2018\/10\/IMG_4623.jpg","contentUrl":"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/2018\/10\/IMG_4623.jpg","width":1024,"height":512},{"@type":"BreadcrumbList","@id":"https:\/\/www.datanovia.com\/en\/blog\/how-to-easily-manipulate-files-and-directories-in-r\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.datanovia.com\/en\/"},{"@type":"ListItem","position":2,"name":"How to Easily Manipulate Files and Directories in R"}]},{"@type":"WebSite","@id":"https:\/\/www.datanovia.com\/en\/#website","url":"https:\/\/www.datanovia.com\/en\/","name":"Datanovia","description":"Data Mining and Statistics for Decision Support","publisher":{"@id":"https:\/\/www.datanovia.com\/en\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.datanovia.com\/en\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.datanovia.com\/en\/#organization","name":"Datanovia","url":"https:\/\/www.datanovia.com\/en\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.datanovia.com\/en\/#\/schema\/logo\/image\/","url":"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/2018\/09\/datanovia-logo.png","contentUrl":"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/2018\/09\/datanovia-logo.png","width":98,"height":99,"caption":"Datanovia"},"image":{"@id":"https:\/\/www.datanovia.com\/en\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.datanovia.com\/en\/#\/schema\/person\/7767cf2bd5c91a1610c6eb53a0ff069e","name":"Alboukadel","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.datanovia.com\/en\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/ed3108646c5c7c3d188324ab972f96ad7d9975b41b94014d7f68257791be395a?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/ed3108646c5c7c3d188324ab972f96ad7d9975b41b94014d7f68257791be395a?s=96&d=mm&r=g","caption":"Alboukadel"},"url":"https:\/\/www.datanovia.com\/en\/blog\/author\/kassambara\/"}]}},"multi-rating":{"mr_rating_results":[]},"_links":{"self":[{"href":"https:\/\/www.datanovia.com\/en\/wp-json\/wp\/v2\/posts\/8494","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.datanovia.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.datanovia.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.datanovia.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.datanovia.com\/en\/wp-json\/wp\/v2\/comments?post=8494"}],"version-history":[{"count":1,"href":"https:\/\/www.datanovia.com\/en\/wp-json\/wp\/v2\/posts\/8494\/revisions"}],"predecessor-version":[{"id":8495,"href":"https:\/\/www.datanovia.com\/en\/wp-json\/wp\/v2\/posts\/8494\/revisions\/8495"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.datanovia.com\/en\/wp-json\/wp\/v2\/media\/8001"}],"wp:attachment":[{"href":"https:\/\/www.datanovia.com\/en\/wp-json\/wp\/v2\/media?parent=8494"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.datanovia.com\/en\/wp-json\/wp\/v2\/categories?post=8494"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.datanovia.com\/en\/wp-json\/wp\/v2\/tags?post=8494"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}