{"id":4898,"date":"2021-08-31T04:34:40","date_gmt":"2021-08-31T04:34:40","guid":{"rendered":"https:\/\/studysection.com\/blog\/?p=4898"},"modified":"2021-08-31T05:38:23","modified_gmt":"2021-08-31T05:38:23","slug":"r-programming-language-overview","status":"publish","type":"post","link":"https:\/\/studysection.com\/blog\/r-programming-language-overview\/","title":{"rendered":"R Programming Language Overview"},"content":{"rendered":"<p>R is a programming language that is used for statistical and visualization analysis. It is also used for reporting. We use this language for data analysis, which gives us results in the form of graphs, pie charts, etc. R is an interpreted <a href=\"https:\/\/studysection.com\/blog\/python-programming-language\/\">programming language<\/a>. It is a simple and well-developed language that uses loops, functions, conditions, etc. For calculations, it uses arrays, matrix, list, and vectors. It provides a graphical representation of the data. It also processes large datasets.<br \/>\nThe basic syntax is given below:<\/p>\n<ul>\n<li>In the R language, there is no need to give data type to a variable. Directly, give value to the variable.<\/li>\n<li>Following is the basic syntax of how to print string in R language:<br \/>\n<code>test<-\u201d Good Morning\u201d;\nprint(test);\no\/p: [1] \u201cGood Morning\u201d<\/code><\/li>\n<li>To comment code in R language # is used.<br \/>\n<code>Eg: #test<-\u201d Good Morning\u201d;<\/code><\/li>\n<\/ul>\n<h3><strong>DATA TYPES: <\/strong>To check the data type of the variable class() is used.<\/h3>\n<ol>\n<li><strong>Logical:<\/strong> It is a type of data type used for True or False value.<br \/>\n<code>Eg: test&lt;-TRUE<br \/>\n      print(class(test))<br \/>\n      o\/p: [1] \"logical\"<\/code>\n<\/li>\n<li><strong>Numeric:<\/strong> It is used for numerical data or numbers.<br \/>\n<code>Eg: test&lt;-8<br \/>\n      print(class(test))<br \/>\n      o\/p: [1] \"numeric<\/code>\"<\/li>\n<li><strong>Complex:<\/strong> It is used for complex data that contains iota values.<br \/>\n<code>Eg: test&lt;-1+2i<br \/>\n      print(class(test))<br \/>\n      o\/p: [1] \"complex\"<\/code><\/li>\n<li><strong>Character:<\/strong> It is used for all the characters. For strings, it belongs to the character datatype.<br \/>\n<code>Eg: test&lt;-\u201dHELLO\u201d<br \/>\n      print(class(test))<br \/>\n      o\/p: [1] \"character\"<\/code><\/li>\n<li><strong>Raw:<\/strong> It is used for the raw character.<br \/>\n<code>Eg: test&lt;-charToRaw(\u201dHELLO\u201d)<br \/>\n      print(class(test))<br \/>\n      o\/p: [1] \"raw\"<\/code><\/li>\n<\/ol>\n<h3><strong>R-Objects:<\/strong> These objects use data types as described above.<\/h3>\n<ol>\n<li><strong>Vectors:<\/strong> Most basic R-object is vectors. Function c() is used for the vectors.<br \/>\n<code>Eg: test &lt;- c('bmw','audi',\u2019maruti\u2019)<br \/>\nprint(test)<br \/>\no\/p: [1] \"bmw\"    \"audi\"  \"maruti\"<br \/>\n# To find class of the vector<br \/>\nprint(class(test))<br \/>\n[1] \"character\"<\/code><\/li>\n<li><strong>Lists:<\/strong> It contains different types of elements in it. It can be numbers, characters, functions, even other lists, etc.<br \/>\n<code>Eg: l1 &lt;- list(c(1,2,3),1.5,3.8)<br \/>\nprint(l1)<br \/>\no\/p: [[1]]\n[1] 1 2 3<br \/>\n[[2]]\n[1] 1.5 3.8<\/code>\n<\/li>\n<li><strong>Matrices:<\/strong> Matrix is a 2-D rectangular data set. It is created using vectors in matrix().<br \/>\n<code>Eg:  m = matrix( c('1','2','3','4','5','6'), nrow = 2, ncol = 3, byrow = TRUE)<br \/>\n#Where nrow is for number of rows, ncol is for number of columns.<br \/>\nprint(m)<br \/>\no\/p:     [,1] [,2] [,3]\n[1,] \"1\"  \"2\"  \"3\"<br \/>\n[2,] \"4\"  \"5\"  \"6\"<\/code>\n<\/li>\n<li><strong>Arrays:<\/strong> Unlike matrices, Arrays can have any number of dimensions. \u2018dim\u2019 attribute is used to create the required number of dimensions.<br \/>\n<code>Eg: arr &lt;- array(c('e1','e2'),dim = c(3,3,2))<br \/>\n# Set dimension of 3 * 3 and the number of arrays will be 2.<br \/>\nprint(arr)<br \/>\n          o\/p:<br \/>\n, , 1<br \/>\n    [,1]     [,2]     [,3]\n[1,] \"e1\"  \"e2\" \"e1\"<br \/>\n[2,] \"e2\" \"e1\"  \"e2\"<br \/>\n[3,] \"e1\"  \"e2\" \"e1\"<br \/>\n,levels   [,1]     [,2]     [,3]\n[1,] \"e2\" \"e1\"  \"e2\"<br \/>\n[2,] \"e1\"  \"e2\" \"e1\"<br \/>\n[3,] \"e2\" \"e1\"  \"e2\"<\/code><\/li>\n<li><strong>Factors:<\/strong> They are created using vectors. factor() is used to create the factors and nlevels() gives the count of levels.<br \/>\n<code>Eg: f1<-c('1','1','2','3','3','2','1')\n# Create a factor object.\nfo &lt;- factor(f1)\n# Print the factor.\nprint(f1)\nprint(nlevels(fo))\no\/p: [1] 1 1 2 3 3 2 1 \nLevels: 1 2 3\n[1] 3<\/code>\n<\/li>\n<li><strong>Data Frames:<\/strong> It is used for tabular data objects. Every column can contain different types of data. It is created with a list of vectors having an equal length. Data frames are created using data.frame().<br \/>\n<code>Eg: vehicle &lt;- data.frame(<br \/>\n   car = c(\"c1\", \"c2\",\"c3\"),<br \/>\n   bike = c(1, 2, 3)<br \/>\n)<br \/>\nprint(vehicle)<br \/>\no\/p: car bike<br \/>\n1   c1  1<br \/>\n2   c2  2<br \/>\n3   c3  3<\/code><\/li>\n<\/ol>\n<p><strong>Conclusion:<\/strong> R language is one of the most widely used Statistical programming languages. This language is used by data scientists.<\/p>\n<p><small><em>jQuery presents a tree-like structure of all the elements on a webpage simplifying the syntax and further manipulating such elements. The <a href=\"https:\/\/www.studysection.com\/jquery-3.x-advanced\">jQuery Certification Exam<\/a> by StudySection will secure your fundamental knowledge and a basic understanding of jQuery as an asset to improve your skills.<\/em><\/small><\/p>\n","protected":false},"excerpt":{"rendered":"<p>R is a programming language that is used for statistical and visualization analysis. It is also used for reporting. We<\/p>\n","protected":false},"author":1,"featured_media":4899,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[76,700],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.7 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>R Programming Language Overview - StudySection Blog<\/title>\n<meta name=\"description\" content=\"R is a programming language that is used for statistical and visualization analysis. R is an interpreted programming language.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/studysection.com\/blog\/r-programming-language-overview\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"R Programming Language Overview - StudySection Blog\" \/>\n<meta property=\"og:description\" content=\"R is a programming language that is used for statistical and visualization analysis. R is an interpreted programming language.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/studysection.com\/blog\/r-programming-language-overview\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog Posts on famous people, innovations and educational topics\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/studysection\" \/>\n<meta property=\"article:published_time\" content=\"2021-08-31T04:34:40+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-08-31T05:38:23+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/studysection.com\/blog\/wp-content\/uploads\/2021\/08\/R-Programming.png\" \/>\n\t<meta property=\"og:image:width\" content=\"300\" \/>\n\t<meta property=\"og:image:height\" content=\"200\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"admin-studysection-blog\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@studysection\" \/>\n<meta name=\"twitter:site\" content=\"@studysection\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin-studysection-blog\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/studysection.com\/blog\/r-programming-language-overview\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/studysection.com\/blog\/r-programming-language-overview\/\"},\"author\":{\"name\":\"admin-studysection-blog\",\"@id\":\"https:\/\/studysection.com\/blog\/#\/schema\/person\/db367e2c29a12d1808fb1979edb3d402\"},\"headline\":\"R Programming Language Overview\",\"datePublished\":\"2021-08-31T04:34:40+00:00\",\"dateModified\":\"2021-08-31T05:38:23+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/studysection.com\/blog\/r-programming-language-overview\/\"},\"wordCount\":399,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/studysection.com\/blog\/#organization\"},\"keywords\":[\"language\",\"R Programming\"],\"articleSection\":[\"Learn and Grow\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/studysection.com\/blog\/r-programming-language-overview\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/studysection.com\/blog\/r-programming-language-overview\/\",\"url\":\"https:\/\/studysection.com\/blog\/r-programming-language-overview\/\",\"name\":\"R Programming Language Overview - StudySection Blog\",\"isPartOf\":{\"@id\":\"https:\/\/studysection.com\/blog\/#website\"},\"datePublished\":\"2021-08-31T04:34:40+00:00\",\"dateModified\":\"2021-08-31T05:38:23+00:00\",\"description\":\"R is a programming language that is used for statistical and visualization analysis. R is an interpreted programming language.\",\"breadcrumb\":{\"@id\":\"https:\/\/studysection.com\/blog\/r-programming-language-overview\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/studysection.com\/blog\/r-programming-language-overview\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/studysection.com\/blog\/r-programming-language-overview\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/studysection.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"R Programming Language Overview\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/studysection.com\/blog\/#website\",\"url\":\"https:\/\/studysection.com\/blog\/\",\"name\":\"Blog Posts on famous people, innovations and educational topics\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/studysection.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/studysection.com\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/studysection.com\/blog\/#organization\",\"name\":\"StudySection\",\"url\":\"https:\/\/studysection.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/studysection.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/studysection.com\/blog\/wp-content\/uploads\/2021\/10\/studySection-logo.png\",\"contentUrl\":\"https:\/\/studysection.com\/blog\/wp-content\/uploads\/2021\/10\/studySection-logo.png\",\"width\":920,\"height\":440,\"caption\":\"StudySection\"},\"image\":{\"@id\":\"https:\/\/studysection.com\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/studysection\",\"https:\/\/twitter.com\/studysection\",\"https:\/\/www.instagram.com\/study.section\/\",\"https:\/\/www.linkedin.com\/company\/studysection\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/studysection.com\/blog\/#\/schema\/person\/db367e2c29a12d1808fb1979edb3d402\",\"name\":\"admin-studysection-blog\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/studysection.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/054ac87a6874df1932004239cd8eab36?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/054ac87a6874df1932004239cd8eab36?s=96&d=mm&r=g\",\"caption\":\"admin-studysection-blog\"},\"url\":\"https:\/\/studysection.com\/blog\/author\/admin-studysection-blog\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"R Programming Language Overview - StudySection Blog","description":"R is a programming language that is used for statistical and visualization analysis. R is an interpreted programming language.","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:\/\/studysection.com\/blog\/r-programming-language-overview\/","og_locale":"en_US","og_type":"article","og_title":"R Programming Language Overview - StudySection Blog","og_description":"R is a programming language that is used for statistical and visualization analysis. R is an interpreted programming language.","og_url":"https:\/\/studysection.com\/blog\/r-programming-language-overview\/","og_site_name":"Blog Posts on famous people, innovations and educational topics","article_publisher":"https:\/\/www.facebook.com\/studysection","article_published_time":"2021-08-31T04:34:40+00:00","article_modified_time":"2021-08-31T05:38:23+00:00","og_image":[{"width":300,"height":200,"url":"https:\/\/studysection.com\/blog\/wp-content\/uploads\/2021\/08\/R-Programming.png","type":"image\/png"}],"author":"admin-studysection-blog","twitter_card":"summary_large_image","twitter_creator":"@studysection","twitter_site":"@studysection","twitter_misc":{"Written by":"admin-studysection-blog","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/studysection.com\/blog\/r-programming-language-overview\/#article","isPartOf":{"@id":"https:\/\/studysection.com\/blog\/r-programming-language-overview\/"},"author":{"name":"admin-studysection-blog","@id":"https:\/\/studysection.com\/blog\/#\/schema\/person\/db367e2c29a12d1808fb1979edb3d402"},"headline":"R Programming Language Overview","datePublished":"2021-08-31T04:34:40+00:00","dateModified":"2021-08-31T05:38:23+00:00","mainEntityOfPage":{"@id":"https:\/\/studysection.com\/blog\/r-programming-language-overview\/"},"wordCount":399,"commentCount":0,"publisher":{"@id":"https:\/\/studysection.com\/blog\/#organization"},"keywords":["language","R Programming"],"articleSection":["Learn and Grow"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/studysection.com\/blog\/r-programming-language-overview\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/studysection.com\/blog\/r-programming-language-overview\/","url":"https:\/\/studysection.com\/blog\/r-programming-language-overview\/","name":"R Programming Language Overview - StudySection Blog","isPartOf":{"@id":"https:\/\/studysection.com\/blog\/#website"},"datePublished":"2021-08-31T04:34:40+00:00","dateModified":"2021-08-31T05:38:23+00:00","description":"R is a programming language that is used for statistical and visualization analysis. R is an interpreted programming language.","breadcrumb":{"@id":"https:\/\/studysection.com\/blog\/r-programming-language-overview\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/studysection.com\/blog\/r-programming-language-overview\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/studysection.com\/blog\/r-programming-language-overview\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/studysection.com\/blog\/"},{"@type":"ListItem","position":2,"name":"R Programming Language Overview"}]},{"@type":"WebSite","@id":"https:\/\/studysection.com\/blog\/#website","url":"https:\/\/studysection.com\/blog\/","name":"Blog Posts on famous people, innovations and educational topics","description":"","publisher":{"@id":"https:\/\/studysection.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/studysection.com\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/studysection.com\/blog\/#organization","name":"StudySection","url":"https:\/\/studysection.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/studysection.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/studysection.com\/blog\/wp-content\/uploads\/2021\/10\/studySection-logo.png","contentUrl":"https:\/\/studysection.com\/blog\/wp-content\/uploads\/2021\/10\/studySection-logo.png","width":920,"height":440,"caption":"StudySection"},"image":{"@id":"https:\/\/studysection.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/studysection","https:\/\/twitter.com\/studysection","https:\/\/www.instagram.com\/study.section\/","https:\/\/www.linkedin.com\/company\/studysection"]},{"@type":"Person","@id":"https:\/\/studysection.com\/blog\/#\/schema\/person\/db367e2c29a12d1808fb1979edb3d402","name":"admin-studysection-blog","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/studysection.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/054ac87a6874df1932004239cd8eab36?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/054ac87a6874df1932004239cd8eab36?s=96&d=mm&r=g","caption":"admin-studysection-blog"},"url":"https:\/\/studysection.com\/blog\/author\/admin-studysection-blog\/"}]}},"views":282,"_links":{"self":[{"href":"https:\/\/studysection.com\/blog\/wp-json\/wp\/v2\/posts\/4898"}],"collection":[{"href":"https:\/\/studysection.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/studysection.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/studysection.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/studysection.com\/blog\/wp-json\/wp\/v2\/comments?post=4898"}],"version-history":[{"count":3,"href":"https:\/\/studysection.com\/blog\/wp-json\/wp\/v2\/posts\/4898\/revisions"}],"predecessor-version":[{"id":4902,"href":"https:\/\/studysection.com\/blog\/wp-json\/wp\/v2\/posts\/4898\/revisions\/4902"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/studysection.com\/blog\/wp-json\/wp\/v2\/media\/4899"}],"wp:attachment":[{"href":"https:\/\/studysection.com\/blog\/wp-json\/wp\/v2\/media?parent=4898"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/studysection.com\/blog\/wp-json\/wp\/v2\/categories?post=4898"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/studysection.com\/blog\/wp-json\/wp\/v2\/tags?post=4898"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}