{"id":77887,"date":"2020-04-01T17:22:04","date_gmt":"2020-04-01T11:52:04","guid":{"rendered":"https:\/\/techvidvan.com\/tutorials\/?p=77887"},"modified":"2020-04-01T17:22:04","modified_gmt":"2020-04-01T11:52:04","slug":"data-manipulation-r","status":"publish","type":"post","link":"https:\/\/techvidvan.com\/tutorials\/data-manipulation-r\/","title":{"rendered":"Data Manipulation in R &#8211; Alter, Sample, Reduce &amp; Elaborate Datasets"},"content":{"rendered":"<p>In this R tutorial of TechVidvan\u2019s R tutorial series, we will learn the basics of data manipulation. We shall study the <strong><code>sort()<\/code><\/strong> and the <strong><code>order()<\/code><\/strong> functions that help in sorting or ordering the data according to desired specifications. Also, we will take a look at the different ways of making a subset of given data. Then, we shall study the working and uses of the sample function. Next up will be merging datasets, where we will look at the <strong><code>cbind()<\/code><\/strong>, <strong><code>rbind()<\/code><\/strong> and the <strong><code>merge()<\/code><\/strong> functions. Finally, we shall then study the <strong><code>apply()<\/code><\/strong> family of functions.<\/p>\n<p>As you can see, we have a packed schedule ahead of us. So, let\u2019s get started.<\/p>\n<h2>Data Manipulation in R<\/h2>\n<p><a href=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2020\/04\/data-manipulation-in-R.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-77888\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2020\/04\/data-manipulation-in-R.jpg\" alt=\"data manipulation in R\" width=\"802\" height=\"420\" \/><\/a><\/p>\n<p>In a data analysis process, the data has to be altered, sampled, reduced or elaborated. Such actions are called <strong>data manipulation<\/strong>. Data has to be manipulated many times during any kind of analysis process. Performing mathematical calculations on a column or making a subset of the data for a predictive sample analysis everything counts as manipulating the data.<\/p>\n<h3>Sorting and Ordering the Data<\/h3>\n<p>The <strong><code>sort()<\/code><\/strong> and the <strong><code>order()<\/code><\/strong> functions are included in the base package of R and are used to sort or order the data in the desired order. Let\u2019s take a look at these functions one-by-one.<\/p>\n<h4>1. The sort function<\/h4>\n<p>The <strong><code>sort()<\/code><\/strong> function <strong>sorts<\/strong> the elements of a vector or a factor in increasing or decreasing order. The syntax of the sort function is:<\/p>\n<p><strong>Code:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">Sort(x, decreasing = FALSE, na.last = NA, . . .)<\/pre>\n<p>Here,<\/p>\n<ul>\n<li><strong><code>x<\/code><\/strong> is the input vector or factor that has to be sorted.<\/li>\n<li><strong><code>decreasing<\/code><\/strong> is a boolean that controls whether the input vector or factor is to be sorted in decreasing order (when set to <strong><code>TRUE<\/code><\/strong>) or in increasing order (when set to <strong><code>FALSE<\/code><\/strong>).<\/li>\n<li><strong><code>na.last<\/code><\/strong> is an argument that controls the treatment of the <strong><code>NA<\/code><\/strong> values present inside the input vector\/factor. If <strong><code>na.last<\/code><\/strong> is set as <strong><code>TRUE<\/code><\/strong>, then the <strong><code>NA<\/code><\/strong> values are put at the last. If it is set as <strong><code>FALSE<\/code><\/strong>, then the <strong><code>NA<\/code><\/strong> values are put first. Finally, if it is set as <strong><code>NA<\/code><\/strong>, then the <strong><code>NA<\/code><\/strong> values are removed.<\/li>\n<\/ul>\n<p>Let us take a look at an example of the sort function:<\/p>\n<p><strong>Code:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">sort(c(3,16,34,77,29,95,24,47,92,64,43), decreasing = FALSE)<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p><a href=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2020\/04\/1-data-manipulation-in-R-sort-function.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-77892\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2020\/04\/1-data-manipulation-in-R-sort-function.png\" alt=\"sort function - data manipulation in R \" width=\"1299\" height=\"741\" \/><\/a><\/p>\n<h4>2. The order function<\/h4>\n<p>The <strong><code>order()<\/code><\/strong> function returns the indices of the elements of the input objects in ascending or descending order. Here is the syntax of the order function.<\/p>\n<p><strong>Code:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">order(. . . , na.last = TRUE, decreasing = FALSE, method = c(\"auto\", \"shell\", \"radix\"))<\/pre>\n<p>Where:<\/p>\n<p><strong><code>. . .<\/code><\/strong> is a sequence of numeric, character, logical or complex vectors or is a classed R object. This is the first argument of the function and is the object(s) that has to be ordered.<\/p>\n<p><strong><code>na.last<\/code><\/strong> is the argument that controls the treatment of <strong><code>NA<\/code><\/strong> values.<br \/>\ndecreasing controls whether the order of the object will be decreasing or increasing.<\/p>\n<p><strong><code>method<\/code><\/strong> is a character string that specifies the algorithm to be used. method can take the value of <strong><code>\u201cauto\u201d<\/code><\/strong>, <strong><code>\u201cradix\u201d<\/code><\/strong>, or <strong><code>\u201cshell\u201d<\/code><\/strong>.<\/p>\n<p>Let\u2019s take a look at this function through an example:<\/p>\n<p><strong>Code:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">a &lt;- c(20,40,70,10,50,30,90,60)\norder(a)\na[order(a)]<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p><a href=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2020\/04\/2-data-manipulation-in-R-order-function.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-77893\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2020\/04\/2-data-manipulation-in-R-order-function.png\" alt=\"order function - order functiondata manipulation in R\" width=\"1299\" height=\"741\" \/><\/a><\/p>\n<h3>Subsetting a Dataset<\/h3>\n<p>There are multiple ways to make subsets of a dataset in R. Depending on the shape and size of the subset, you can either use different operators to index certain parts of a dataset and assign those parts to a variable. These operators are:<\/p>\n<h4>1. The $ operator<\/h4>\n<p>The <strong><code>$<\/code><\/strong> sign can be used to access a single variable(column) of a dataset. The result of using this notation is a single length vector.<\/p>\n<h4>2. The [[ operator<\/h4>\n<p>The <strong><code>[[<\/code><\/strong> operator selects a single element like the $ notation. Unlike the $ operator, the [[ operator can be used by specifying the target position instead of the name of the target element.<\/p>\n<h4>3. The [ operator<\/h4>\n<p>The <strong><code>[<\/code><\/strong> operator takes a numeric, character, or a logical vector to identify its target. This operator returns multiple elements depending on the given target indices.<\/p>\n<p>Here is an example of all three of the above operators.<\/p>\n<p><strong>Code:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">mtcars$hp\nmtcars[[4]]\nmtcars[4]<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<h4><a href=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2020\/04\/3-data-manipulation-in-R-index-operators.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-77894\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2020\/04\/3-data-manipulation-in-R-index-operators.png\" alt=\"data manipulation in R- index operators\" width=\"1299\" height=\"741\" \/><\/a><\/h4>\n<h4>The sample function<\/h4>\n<p>The <strong><code>sample()<\/code><\/strong> function returns <strong>random samples<\/strong> of the given data. The arguments of the function can be used to specify how big the samples need to be and also how many samples should be returned. Here is an example of the sample function in action.<\/p>\n<p><strong>Code:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">sample(mtcars, 3)<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p><a href=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2020\/04\/4-data-manipulation-in-R-sample-function.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-77899\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2020\/04\/4-data-manipulation-in-R-sample-function.png\" alt=\"data manipulation in R- sample function\" width=\"1299\" height=\"741\" \/><\/a><\/p>\n<h3>Merging Datasets<\/h3>\n<p>There are multiple ways to merging\/combining datasets in <a href=\"https:\/\/www.r-project.org\/\">R<\/a>. We will be taking a look at the <strong>cbind()<\/strong>, the rbind(), and the merge() functions of R that allow us to do so.<\/p>\n<h4>1. The cbind function<\/h4>\n<p>The cbind() function combines two dataset (or data frames) along their columns.<\/p>\n<p><strong>Code:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">m1 &lt;- matrix(c(1:9),c(3,3))\nm2 &lt;- matrix(c(10:18),c(3,3))\ncbind(m1,m2)<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p><a href=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2020\/04\/5-data-manipulation-in-R-cbind-function.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-77900\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2020\/04\/5-data-manipulation-in-R-cbind-function.png\" alt=\"data manipulation in R- cbind function\" width=\"1299\" height=\"741\" \/><\/a><\/p>\n<h4>2. The rbind function<\/h4>\n<p>The <strong><code>rbind()<\/code><\/strong> function combines two data frames along their rows. If the two data frames have identical variables, then rbind is the easiest way to combine them into one data frame with a larger number of rows.<\/p>\n<p><strong>Code:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">rbind(m1,m2)<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p><a href=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2020\/04\/6-data-manipulation-in-R-rbind-function.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-77901\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2020\/04\/6-data-manipulation-in-R-rbind-function.png\" alt=\"data manipulation in R- rbind function\" width=\"1299\" height=\"741\" \/><\/a><\/p>\n<h4>3. The merge function<\/h4>\n<p>The merge() function performs what is called a join operation in databases. This function combines two data frames based on common columns.<\/p>\n<p><strong>Code:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">names &lt;- c('v1','v2','v3')\ncolnames(m1) &lt;- names\ncolnames(m2) &lt;- names\nmerge(m1,m2, by = names, all = TRUE)<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p><a href=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2020\/04\/7_data-manipulation-in-r-merge-function-1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-77906\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2020\/04\/7_data-manipulation-in-r-merge-function-1.png\" alt=\"data manipulation in r - merge function\" width=\"1299\" height=\"741\" \/><\/a><\/p>\n<h3>The apply family of functions<\/h3>\n<p>The apply collection of functions act like substitutes for loops in R. The functions are different based on their working inputs ad output formats, but the basic idea is the same. These functions apply a function on all the elements of a data structure. Let us take a look at these function one-by-one.<\/p>\n<h4>1. The apply function<\/h4>\n<p>The apply() function applies a function over the margins of the array or a matrix and returns the results in the form of a vector, list or an array.<\/p>\n<p><strong>Code:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">apply(m1, 1, sum)<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p><a href=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2020\/04\/8.data-manipulation-in-r-apply-function.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-77905\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2020\/04\/8.data-manipulation-in-r-apply-function.png\" alt=\"data manipulation in r - apply function\" width=\"1366\" height=\"768\" \/><\/a><\/p>\n<h4><\/h4>\n<h4>2. The lapply function<\/h4>\n<p>The lapply() function applies a given function over the elements of an input vector. The function returns the results in the form of a list which is of the same length as the input vector.<\/p>\n<p><strong>Code:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">list1 &lt;- list(c(1:5),c(3,46,7,3,6,4,6),c(1:15))\nlapply(list1, mean)<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p><a href=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2020\/04\/9-data-manipulation-in-R-lapply-function.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-77904\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2020\/04\/9-data-manipulation-in-R-lapply-function.png\" alt=\"data manipulation in R- lapply function\" width=\"1299\" height=\"741\" \/><\/a><\/p>\n<h4>3. The sapply function<\/h4>\n<p>The sapply() function does the same job as the lapply() function. The difference being that the sapply function returns the output in the most simplified data structure possible unless the simplify argument is set to FALSE.<\/p>\n<p><strong>Code:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">sapply(list1, mean)\nsapply(list1, mean, simplify = FALSE)<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p><a href=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2020\/04\/10-data-manipulation-in-R-sapply-function.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-77903\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2020\/04\/10-data-manipulation-in-R-sapply-function.png\" alt=\"data manipulation in R- sapply function\" width=\"1299\" height=\"741\" \/><\/a><\/p>\n<h2>Summary<\/h2>\n<p>In this article of TechVidvan\u2019s R tutorial series, we learned the basics of data manipulation in R. We studied the <strong><code>sort()<\/code><\/strong> and the <strong><code>order()<\/code><\/strong> function that help in sorting the elements of vectors, arrays, matrices, or data frames. We looked at the different operators that help us in making subsets of our data. Also, learned about the <strong><code>sample()<\/code><\/strong> function that allows us to take random samples of a specified length from the given data. We then looked at the functions that help us combine two datasets. Finally, we studied the <strong><code>apply()<\/code><\/strong>, the <strong><code>lapply()<\/code><\/strong> and the <strong><code>sapply()<\/code><\/strong> functions.<\/p>\n<p>I hope now you know data manipulation in R works.<\/p>\n<p>Now, its time to gain more knowledge about your data with <a href=\"https:\/\/techvidvan.com\/tutorials\/r-descriptive-statistics\/\"><strong>Descriptive Statistics in R<\/strong><\/a>.<\/p>\n<p>If you still finding any difficulty in it asks our <strong>TechVidvan<\/strong> team.<\/p>\n<p>Keep Learning!!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this R tutorial of TechVidvan\u2019s R tutorial series, we will learn the basics of data manipulation. We shall study the sort() and the order() functions that help in sorting or ordering the data&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":77888,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1020],"tags":[2251,2252,2253,2254,2255,2256,2257,2258,2259],"class_list":["post-77887","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-r","tag-data-manipulation-in-r","tag-managing-and-manipulating-data-in-r","tag-manipulating-and-processing-data-in-r","tag-merge-function-in-r","tag-r-data-frame-manipulation","tag-r-manipulate-data-frame","tag-r-manipulation","tag-r-variable","tag-sample-function-in-r"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Data Manipulation in R - Alter, Sample, Reduce &amp; Elaborate Datasets - TechVidvan<\/title>\n<meta name=\"description\" content=\"data manipulation in R - In this article of R tutorial series, explore basics of data manipulation in R. Expore Alter, Sample, Reduce &amp; Elaborate Datasets.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/techvidvan.com\/tutorials\/data-manipulation-r\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Data Manipulation in R - Alter, Sample, Reduce &amp; Elaborate Datasets - TechVidvan\" \/>\n<meta property=\"og:description\" content=\"data manipulation in R - In this article of R tutorial series, explore basics of data manipulation in R. Expore Alter, Sample, Reduce &amp; Elaborate Datasets.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/techvidvan.com\/tutorials\/data-manipulation-r\/\" \/>\n<meta property=\"og:site_name\" content=\"TechVidvan\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/TechVidvan\/\" \/>\n<meta property=\"article:published_time\" content=\"2020-04-01T11:52:04+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2020\/04\/data-manipulation-in-R.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"802\" \/>\n\t<meta property=\"og:image:height\" content=\"420\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"TechVidvan Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@vidvantech\" \/>\n<meta name=\"twitter:site\" content=\"@vidvantech\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"TechVidvan Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Data Manipulation in R - Alter, Sample, Reduce &amp; Elaborate Datasets - TechVidvan","description":"data manipulation in R - In this article of R tutorial series, explore basics of data manipulation in R. Expore Alter, Sample, Reduce & Elaborate Datasets.","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:\/\/techvidvan.com\/tutorials\/data-manipulation-r\/","og_locale":"en_US","og_type":"article","og_title":"Data Manipulation in R - Alter, Sample, Reduce &amp; Elaborate Datasets - TechVidvan","og_description":"data manipulation in R - In this article of R tutorial series, explore basics of data manipulation in R. Expore Alter, Sample, Reduce & Elaborate Datasets.","og_url":"https:\/\/techvidvan.com\/tutorials\/data-manipulation-r\/","og_site_name":"TechVidvan","article_publisher":"https:\/\/www.facebook.com\/TechVidvan\/","article_published_time":"2020-04-01T11:52:04+00:00","og_image":[{"width":802,"height":420,"url":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2020\/04\/data-manipulation-in-R.jpg","type":"image\/jpeg"}],"author":"TechVidvan Team","twitter_card":"summary_large_image","twitter_creator":"@vidvantech","twitter_site":"@vidvantech","twitter_misc":{"Written by":"TechVidvan Team","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/techvidvan.com\/tutorials\/data-manipulation-r\/#article","isPartOf":{"@id":"https:\/\/techvidvan.com\/tutorials\/data-manipulation-r\/"},"author":{"name":"TechVidvan Team","@id":"https:\/\/techvidvan.com\/tutorials\/#\/schema\/person\/e9c26e74dd3d87421f7ada9433b8cd22"},"headline":"Data Manipulation in R &#8211; Alter, Sample, Reduce &amp; Elaborate Datasets","datePublished":"2020-04-01T11:52:04+00:00","mainEntityOfPage":{"@id":"https:\/\/techvidvan.com\/tutorials\/data-manipulation-r\/"},"wordCount":1087,"commentCount":0,"publisher":{"@id":"https:\/\/techvidvan.com\/tutorials\/#organization"},"image":{"@id":"https:\/\/techvidvan.com\/tutorials\/data-manipulation-r\/#primaryimage"},"thumbnailUrl":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2020\/04\/data-manipulation-in-R.jpg","keywords":["Data Manipulation in R","managing and manipulating data in R","manipulating and processing data in R","merge function in R","R data frame manipulation","R manipulate data frame","R manipulation","R variable","sample function in R"],"articleSection":["R Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/techvidvan.com\/tutorials\/data-manipulation-r\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/techvidvan.com\/tutorials\/data-manipulation-r\/","url":"https:\/\/techvidvan.com\/tutorials\/data-manipulation-r\/","name":"Data Manipulation in R - Alter, Sample, Reduce &amp; Elaborate Datasets - TechVidvan","isPartOf":{"@id":"https:\/\/techvidvan.com\/tutorials\/#website"},"primaryImageOfPage":{"@id":"https:\/\/techvidvan.com\/tutorials\/data-manipulation-r\/#primaryimage"},"image":{"@id":"https:\/\/techvidvan.com\/tutorials\/data-manipulation-r\/#primaryimage"},"thumbnailUrl":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2020\/04\/data-manipulation-in-R.jpg","datePublished":"2020-04-01T11:52:04+00:00","description":"data manipulation in R - In this article of R tutorial series, explore basics of data manipulation in R. Expore Alter, Sample, Reduce & Elaborate Datasets.","breadcrumb":{"@id":"https:\/\/techvidvan.com\/tutorials\/data-manipulation-r\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/techvidvan.com\/tutorials\/data-manipulation-r\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/techvidvan.com\/tutorials\/data-manipulation-r\/#primaryimage","url":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2020\/04\/data-manipulation-in-R.jpg","contentUrl":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2020\/04\/data-manipulation-in-R.jpg","width":802,"height":420,"caption":"data manipulation in R"},{"@type":"BreadcrumbList","@id":"https:\/\/techvidvan.com\/tutorials\/data-manipulation-r\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/techvidvan.com\/tutorials\/"},{"@type":"ListItem","position":2,"name":"Data Manipulation in R &#8211; Alter, Sample, Reduce &amp; Elaborate Datasets"}]},{"@type":"WebSite","@id":"https:\/\/techvidvan.com\/tutorials\/#website","url":"https:\/\/techvidvan.com\/tutorials\/","name":"TechVidvan Blogs","description":"","publisher":{"@id":"https:\/\/techvidvan.com\/tutorials\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/techvidvan.com\/tutorials\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/techvidvan.com\/tutorials\/#organization","name":"TechVidvan","url":"https:\/\/techvidvan.com\/tutorials\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/techvidvan.com\/tutorials\/#\/schema\/logo\/image\/","url":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2024\/03\/techvidvan-logo-200x50-1.webp","contentUrl":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2024\/03\/techvidvan-logo-200x50-1.webp","width":200,"height":50,"caption":"TechVidvan"},"image":{"@id":"https:\/\/techvidvan.com\/tutorials\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/TechVidvan\/","https:\/\/x.com\/vidvantech"]},{"@type":"Person","@id":"https:\/\/techvidvan.com\/tutorials\/#\/schema\/person\/e9c26e74dd3d87421f7ada9433b8cd22","name":"TechVidvan Team","description":"The TechVidvan Team delivers practical, beginner-friendly tutorials on programming, Java, Python, C++, DSA, AI, ML, data Science, Android, Flutter, MERN, Web Development, and technology. Our experts are here to help you upskill and excel in today\u2019s tech industry."}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/posts\/77887","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/comments?post=77887"}],"version-history":[{"count":0,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/posts\/77887\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/media\/77888"}],"wp:attachment":[{"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/media?parent=77887"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/categories?post=77887"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/tags?post=77887"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}