{"id":75330,"date":"2020-01-10T15:51:12","date_gmt":"2020-01-10T10:21:12","guid":{"rendered":"https:\/\/techvidvan.com\/tutorials\/?p=75330"},"modified":"2020-01-10T15:51:12","modified_gmt":"2020-01-10T10:21:12","slug":"r-data-frames","status":"publish","type":"post","link":"https:\/\/techvidvan.com\/tutorials\/r-data-frames\/","title":{"rendered":"How to create, index and modify Data Frame in R?"},"content":{"rendered":"<p><strong>This TechVidvan article is designed to help you in creating, accessing, and modifying data frame in R.<\/strong><\/p>\n<p>Data frames are lists that have a class of <strong>\u201cdata frame\u201d<\/strong>. They are a special case of lists where all the components are of <strong>equal length<\/strong>.<\/p>\n<p>In this R tutorial, we will take a look at R data frames. We will understand their nature and role in R programming. We will learn how to create and navigate them. We will also learn about modifying them and much more.<\/p>\n<p>So, without any delay, let\u2019s begin!<\/p>\n<h2>What are data frames in R?<\/h2>\n<p>Data frames store data tables in R. If you import a dataset in a variable, R stores the variable as a data frame. In the simplest of terms, they are lists of vectors of equal length.<\/p>\n<p>In a data frame, the columns represent component variables while the rows represent observations. While the most common use of data frames in R is to import datasets into them, we will start with creating our own data frame.<\/p>\n<p><em>Not familiar with the <strong><a href=\"https:\/\/techvidvan.com\/tutorials\/r-vector\/\">R vector<\/a><\/strong>? Have a basic understanding of it.<\/em><\/p>\n<h3>How to create a data frame in R?<\/h3>\n<p>To create a data frame, we can use the <strong><code>data.frame()<\/code><\/strong> function. For example:<\/p>\n<p><strong>Code:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&gt; vec1 &lt;- c(\"pencil\",\"pen\",\"eraser\",\"notebook\",\"compass\")\n&gt; vec2 &lt;- c(TRUE,TRUE,FALSE,FALSE,TRUE)\n&gt; vec3 &lt;- c(2.0, 5.0, 1.0, 20.0, 10.0)\n&gt; data &lt;- data.frame(vec1,vec2,vec3, stringAsFactor=FALSE)\n&gt; data<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p><a href=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2020\/01\/1.data-frames-in-r-creating-dataframes-data.frame_.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-75338\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2020\/01\/1.data-frames-in-r-creating-dataframes-data.frame_.png\" alt=\"creating R data.frame()\" width=\"1299\" height=\"741\" \/><\/a><\/p>\n<p>In this example, we used three vectors vec1, vec2, and vec3. Notice that the three vectors are of the same length. The <strong><code>data.frame()<\/code><\/strong> function converts the vectors into columns of data.<\/p>\n<p><strong>Note<\/strong>: By default, the <strong><code>data.frame()<\/code><\/strong> function converts character variables into factors. To avoid this behavior use the <strong><code>stringAsFactors = FALSE<\/code><\/strong> argument. In the next section, we will learn a few important functions that help us gain more information about a data frame.<\/p>\n<h3>Data Frames Functions<\/h3>\n<p>There are a few functions in R that give us important information about objects. These functions are very useful when working with data frames. Data frames are usually very large collections of data. It is easier to use functions that give insight into them instead of looking manually. Some of these functions are:<\/p>\n<p><strong>1. <code>str()<\/code><\/strong> &#8211; The <strong><code>str()<\/code><\/strong> function tells us the <strong>structure<\/strong> of the data frames. It tells us how many and what variables a data frame has, what are their <a href=\"https:\/\/techvidvan.com\/tutorials\/r-data-types\/\"><strong>data types<\/strong><\/a>, and how many observations they have.<\/p>\n<p><strong>Code:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&gt; str(data)<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p><a href=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2020\/01\/2.data-frames-in-r-str.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-75339\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2020\/01\/2.data-frames-in-r-str.png\" alt=\"data frames in r str()\" width=\"1299\" height=\"741\" \/><\/a><\/p>\n<p><strong>2. <code>names()<\/code><\/strong> &#8211; The names function returns the names of the variables in a data frame that is the names of all the columns. We can also use the <strong><code>names()<\/code><\/strong> function to change the names of the variables.<\/p>\n<p><strong>Code:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&gt; names(data)<\/pre>\n<p><strong>Code:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&gt; names(data) &lt;- c(\"item-name\",\"in-stock\",\"price\")\n&gt; names(data)<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p><a href=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2020\/01\/3.data-frames-in-r-names.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-75340\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2020\/01\/3.data-frames-in-r-names.png\" alt=\"R data frames names()\" width=\"1299\" height=\"741\" \/><\/a><\/p>\n<p>3. <strong><code>nrow()<\/code><\/strong> &#8211; The <strong><code>nrow()<\/code><\/strong> function returns the number of rows or observations in a data frame.<\/p>\n<p>4. <strong><code>ncol()<\/code><\/strong> &#8211; The <strong><code>ncol()<\/code><\/strong> function returns the number of columns or variables in a <a href=\"https:\/\/en.wikipedia.org\/?title=Data_frame&amp;redirect=no\">data frame<\/a>.<\/p>\n<p>5.<strong> <code>length()<\/code><\/strong> &#8211; The <strong><code>length()<\/code><\/strong> function returns the length of a data frame which is the same as the <strong><code>ncol<\/code><\/strong> property.<\/p>\n<p><strong>Code:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&gt; nrow(data)<\/pre>\n<p><strong>Code:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&gt; ncol(data)<\/pre>\n<p><strong>Code:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&gt; length(data)<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p><strong><a href=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2020\/01\/4.data-frames-in-r-nrow-ncol-length.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-75341 size-full\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2020\/01\/4.data-frames-in-r-nrow-ncol-length.png\" alt=\"data frames in r - nrow() ncol() length()\" width=\"1299\" height=\"741\" \/><\/a><\/strong><\/p>\n<p>6. <strong><code>head()<\/code><\/strong> &#8211; The <strong><code>head()<\/code><\/strong> function returns the first n rows of a data frame.<\/p>\n<p>7. <strong><code>tail()<\/code><\/strong> &#8211; The <strong><code>tail()<\/code><\/strong> function returns the last n rows of a data frame.<\/p>\n<p><strong>Code:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&gt; head(data,2)<\/pre>\n<p><strong>Code:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&gt; tail(data,2)<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p><a href=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2020\/01\/5.data-frames-in-r-head-tail.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-75342\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2020\/01\/5.data-frames-in-r-head-tail.png\" alt=\"data frames - head() tail()\" width=\"1299\" height=\"741\" \/><\/a><\/p>\n<h3>How to access Elements of data frame in R?<\/h3>\n<p>To access a column of a data frame, we can use the square bracket <strong><code>[ ]<\/code><\/strong> or the double square brackets <strong><code>[[ ]]<\/code><\/strong> or the dollar sign <strong><code>$<\/code><\/strong>. For example:<\/p>\n<p><strong>Code:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&gt; data[\"item-name\"]\n&gt; data[[\"item-name\"]]\n&gt; data$`item-name`<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p><strong><a href=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2020\/01\/6.data-frames-in-r-indexing-columns.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-75345\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2020\/01\/6.data-frames-in-r-indexing-columns.png\" alt=\"R data frames - indexing columns\" width=\"1299\" height=\"741\" \/><\/a><\/strong>We can provide <strong>indices<\/strong> for rows and columns to access specific elements. For example:<\/p>\n<p><strong>Code:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&gt; data[1:3,] #first three rows of data\n&gt; data[1:4,1] #first to fourth row and first column of data\n&gt; data[1:4,1, drop=FALSE] #first to fourth row and first column of data wothout drop<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p><strong><a href=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2020\/01\/7.data-frames-in-r-indexing-elements.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-75346\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2020\/01\/7.data-frames-in-r-indexing-elements.png\" alt=\"data frames in r - indexing elements\" width=\"1299\" height=\"741\" \/><\/a><\/strong>We can also use conditionals as <strong>queries<\/strong> to select only certain items from the list. For example:<\/p>\n<p>If we need to find the items whose price is more than 5.<\/p>\n<p><strong>Code:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&gt; data[data$price &gt;5,]<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p><strong><a href=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2020\/01\/8.data-frames-in-r-indexing-with-conditionals.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-75347\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2020\/01\/8.data-frames-in-r-indexing-with-conditionals.png\" alt=\"data frames in r - indexing with conditionals\" width=\"1299\" height=\"741\" \/><\/a><\/strong><\/p>\n<h3>How to change values in the R data frame?<\/h3>\n<h4>Modifying the values<\/h4>\n<p>We can modify a data frame using <strong>indexing techniques<\/strong> and <strong>reassignment<\/strong>. For example:<\/p>\n<p><strong>Code:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&gt; data<\/pre>\n<p><strong>Code:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&gt; data[3,\"in-stock\"] &lt;- TRUE\n&gt; data<\/pre>\n<p><strong>Output<\/strong>:<\/p>\n<p><strong><a href=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2020\/01\/9.data-frames-in-r-modify-elements.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-75348\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2020\/01\/9.data-frames-in-r-modify-elements.png\" alt=\"R data frames modify elements\" width=\"1299\" height=\"741\" \/><\/a><\/strong><\/p>\n<h4>Adding rows<\/h4>\n<p>We can add rows to a data frame by using the<strong><code>rbind()<\/code><\/strong> function. For example:<\/p>\n<p><strong>Code:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&gt; new_row &lt;- list(\"crayons\",TRUE,20.0)\n&gt; data &lt;- rbind(data,new_row)\n&gt; data<\/pre>\n<p><strong>Output:<\/strong><strong><a href=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2020\/01\/10.data-frames-in-r-adding-a-row-with-rbind.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-75349\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2020\/01\/10.data-frames-in-r-adding-a-row-with-rbind.png\" alt=\"data frames in r - adding a row with rbind()\" width=\"1299\" height=\"741\" \/><\/a><\/strong><\/p>\n<h4>Adding columns<\/h4>\n<p>Similarly, we can add a column by using the<strong><code>cbind()<\/code><\/strong>function. For example:<\/p>\n<p><strong>Code:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&gt; quantity &lt;- c(100,60,80,0,30,25)\n&gt; data &lt;- cbind(data,quantity)\n&gt; data<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p><strong><a href=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2020\/01\/11.data-frames-in-r-adding-a-column-with-cbind.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-75350\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2020\/01\/11.data-frames-in-r-adding-a-column-with-cbind.png\" alt=\"data frames in r - adding a column with cbind()\" width=\"1299\" height=\"741\" \/><\/a><\/strong><\/p>\n<h4>Deleting columns<\/h4>\n<p>We can delete columns of a data frame by reassigning them as NULL.<\/p>\n<p><strong>Code:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&gt; data$quantity &lt;- NULL\n&gt; data<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p><strong><a href=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2020\/01\/12.data-frames-in-r-deleting-columns.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-75351\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2020\/01\/12.data-frames-in-r-deleting-columns.png\" alt=\"data frames in r deleting columns\" width=\"1299\" height=\"741\" \/><\/a><\/strong><\/p>\n<h4>Deleting rows<\/h4>\n<p>We can also remove rows from a data frame through reassignment. For example:<\/p>\n<p><strong>Code:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&gt; data &lt;- data[-6,]\n&gt; data<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<h2><strong><a href=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2020\/01\/13.data-frames-in-r-deleting-rows.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-75352\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2020\/01\/13.data-frames-in-r-deleting-rows.png\" alt=\"deleting rows in R data frames\" width=\"1299\" height=\"741\" \/><\/a><\/strong>Summary<\/h2>\n<p>Data frames are the <strong>most used<\/strong> data structures of R when it comes to data analysis and data science. They are <strong>two-dimensional<\/strong> <a href=\"https:\/\/techvidvan.com\/tutorials\/r-data-structures\/\"><strong>data structures<\/strong><\/a> that help store tabular data with different types.<\/p>\n<p>Today, we learned about the data frames in the R programming language. We learned how to create, access and manipulate them. We also looked at some essential functions in dealing with R data frames.<\/p>\n<p>I hope our R data frame article helped you solve your problems.<\/p>\n<p>Keep Learning!!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This TechVidvan article is designed to help you in creating, accessing, and modifying data frame in R. Data frames are lists that have a class of \u201cdata frame\u201d. They are a special case of&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":75371,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1020],"tags":[1339,1340,1341,1249,1342,1343,1344],"class_list":["post-75330","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-r","tag-data-frames-in-r","tag-modify-data-frame-in-r","tag-r-create-dataframe","tag-r-data-frame","tag-r-data-frame-function","tag-r-data-frame-operations","tag-r-data-frames-tutorial"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.7 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to create, index and modify Data Frame in R? - TechVidvan<\/title>\n<meta name=\"description\" content=\"R data frame - Learn to create data frames, access &amp; modify them in R. And also learn the various functions to get insight into them instead of looking manually.\" \/>\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\/r-data-frames\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to create, index and modify Data Frame in R? - TechVidvan\" \/>\n<meta property=\"og:description\" content=\"R data frame - Learn to create data frames, access &amp; modify them in R. And also learn the various functions to get insight into them instead of looking manually.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/techvidvan.com\/tutorials\/r-data-frames\/\" \/>\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-01-10T10:21:12+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2020\/01\/data-frames-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=\"5 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to create, index and modify Data Frame in R? - TechVidvan","description":"R data frame - Learn to create data frames, access & modify them in R. And also learn the various functions to get insight into them instead of looking manually.","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\/r-data-frames\/","og_locale":"en_US","og_type":"article","og_title":"How to create, index and modify Data Frame in R? - TechVidvan","og_description":"R data frame - Learn to create data frames, access & modify them in R. And also learn the various functions to get insight into them instead of looking manually.","og_url":"https:\/\/techvidvan.com\/tutorials\/r-data-frames\/","og_site_name":"TechVidvan","article_publisher":"https:\/\/www.facebook.com\/TechVidvan\/","article_published_time":"2020-01-10T10:21:12+00:00","og_image":[{"width":802,"height":420,"url":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2020\/01\/data-frames-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":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/techvidvan.com\/tutorials\/r-data-frames\/#article","isPartOf":{"@id":"https:\/\/techvidvan.com\/tutorials\/r-data-frames\/"},"author":{"name":"TechVidvan Team","@id":"https:\/\/techvidvan.com\/tutorials\/#\/schema\/person\/e9c26e74dd3d87421f7ada9433b8cd22"},"headline":"How to create, index and modify Data Frame in R?","datePublished":"2020-01-10T10:21:12+00:00","mainEntityOfPage":{"@id":"https:\/\/techvidvan.com\/tutorials\/r-data-frames\/"},"wordCount":751,"commentCount":0,"publisher":{"@id":"https:\/\/techvidvan.com\/tutorials\/#organization"},"image":{"@id":"https:\/\/techvidvan.com\/tutorials\/r-data-frames\/#primaryimage"},"thumbnailUrl":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2020\/01\/data-frames-in-R.jpg","keywords":["Data Frames in R","Modify Data Frame in R","R create dataframe","R Data Frame","R data frame function","R Data Frame\u00a0Operations","R Data Frames Tutorial"],"articleSection":["R Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/techvidvan.com\/tutorials\/r-data-frames\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/techvidvan.com\/tutorials\/r-data-frames\/","url":"https:\/\/techvidvan.com\/tutorials\/r-data-frames\/","name":"How to create, index and modify Data Frame in R? - TechVidvan","isPartOf":{"@id":"https:\/\/techvidvan.com\/tutorials\/#website"},"primaryImageOfPage":{"@id":"https:\/\/techvidvan.com\/tutorials\/r-data-frames\/#primaryimage"},"image":{"@id":"https:\/\/techvidvan.com\/tutorials\/r-data-frames\/#primaryimage"},"thumbnailUrl":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2020\/01\/data-frames-in-R.jpg","datePublished":"2020-01-10T10:21:12+00:00","description":"R data frame - Learn to create data frames, access & modify them in R. And also learn the various functions to get insight into them instead of looking manually.","breadcrumb":{"@id":"https:\/\/techvidvan.com\/tutorials\/r-data-frames\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/techvidvan.com\/tutorials\/r-data-frames\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/techvidvan.com\/tutorials\/r-data-frames\/#primaryimage","url":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2020\/01\/data-frames-in-R.jpg","contentUrl":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2020\/01\/data-frames-in-R.jpg","width":802,"height":420,"caption":"R data frames"},{"@type":"BreadcrumbList","@id":"https:\/\/techvidvan.com\/tutorials\/r-data-frames\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/techvidvan.com\/tutorials\/"},{"@type":"ListItem","position":2,"name":"How to create, index and modify Data Frame in R?"}]},{"@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\/75330","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=75330"}],"version-history":[{"count":0,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/posts\/75330\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/media\/75371"}],"wp:attachment":[{"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/media?parent=75330"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/categories?post=75330"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/tags?post=75330"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}