{"id":954,"date":"2020-01-21T09:50:37","date_gmt":"2020-01-21T09:50:37","guid":{"rendered":"https:\/\/blog.amt.in\/?p=954"},"modified":"2020-01-21T09:50:37","modified_gmt":"2020-01-21T09:50:37","slug":"introduction-to-r-programming-language","status":"publish","type":"post","link":"https:\/\/blog.amt.in\/index.php\/2020\/01\/21\/introduction-to-r-programming-language\/","title":{"rendered":"Introduction to R (Programming Language)"},"content":{"rendered":"<p>R\u00c2\u00a0is a\u00c2\u00a0programming language\u00c2\u00a0and\u00c2\u00a0free software\u00c2\u00a0environment for\u00c2\u00a0statistical computing\u00c2\u00a0and graphics supported by the R Foundation for Statistical Computing.\u00c2\u00a0The R language is widely used among\u00c2\u00a0statisticians\u00c2\u00a0and\u00c2\u00a0data miners\u00c2\u00a0for developing\u00c2\u00a0statistical software\u00c2\u00a0and\u00c2\u00a0data analysis.\u00c2\u00a0Polls,\u00c2\u00a0data mining surveys, and studies of scholarly literature databases show substantial increases in popularity;\u00c2\u00a0as of November 2019,\u00c2\u00a0R ranks 16th in the\u00c2\u00a0TIOBE index, a measure of popularity of programming languages.<\/p>\n<p>A\u00c2\u00a0GNU package,\u00c2\u00a0source code\u00c2\u00a0for the R software environment is written primarily in\u00c2\u00a0C,\u00c2\u00a0Fortran, and\u00c2\u00a0R itself\u00c2\u00a0and is freely available under the\u00c2\u00a0GNU General Public License. Pre-compiled binary versions are provided for various\u00c2\u00a0operating systems. Although R has a\u00c2\u00a0command line interface, there are several\u00c2\u00a0graphical user interfaces, such as\u00c2\u00a0RStudio, an\u00c2\u00a0integrated development environment.<\/p>\n<p>R and its libraries implement a wide variety of statistical and\u00c2\u00a0graphical\u00c2\u00a0techniques, including\u00c2\u00a0linear\u00c2\u00a0and\u00c2\u00a0nonlinear\u00c2\u00a0modeling, classical statistical tests,\u00c2\u00a0time-series analysis, classification, clustering, and others. R is easily extensible through functions and extensions, and the R community is noted for its active contributions in terms of packages. Many of R&#8217;s standard functions are written in R itself, which makes it easy for users to follow the algorithmic choices made. For computationally intensive tasks,\u00c2\u00a0C,\u00c2\u00a0C++, and\u00c2\u00a0Fortran\u00c2\u00a0code can be\u00c2\u00a0linked\u00c2\u00a0and called at run time. Advanced users can write C, C++,\u00c2\u00a0Java. NET\u00c2\u00a0or\u00c2\u00a0Python\u00c2\u00a0code to manipulate R objects directly.\u00c2\u00a0R is highly extensible through the use of user-submitted packages for specific functions or specific areas of study. Due to its\u00c2\u00a0S\u00c2\u00a0heritage, R has stronger\u00c2\u00a0object-oriented programming\u00c2\u00a0facilities than most statistical computing languages. Extending R is also eased by its\u00c2\u00a0lexical scoping\u00c2\u00a0rules.<\/p>\n<p>Another strength of R is static graphics, which can produce publication-quality graphs, including mathematical symbols. Dynamic and interactive graphics are available through additional packages.<\/p>\n<p>R has Rd, its own\u00c2\u00a0LaTeX-like documentation format, which is used to supply comprehensive documentation, both online in a number of formats and in hard copy.<\/p>\n<p>Like other similar languages such as\u00c2\u00a0APL\u00c2\u00a0and\u00c2\u00a0MATLAB, R supports\u00c2\u00a0matrix arithmetic. R&#8217;s\u00c2\u00a0data structures\u00c2\u00a0include\u00c2\u00a0vectors,\u00c2\u00a0matrices, arrays, data frames (similar to\u00c2\u00a0tables\u00c2\u00a0in a\u00c2\u00a0relational database) and\u00c2\u00a0lists.\u00c2\u00a0Arrays are stored in\u00c2\u00a0column-major order.\u00c2\u00a0R&#8217;s extensible object system includes objects for (among others):\u00c2\u00a0regression models,\u00c2\u00a0time-series\u00c2\u00a0and\u00c2\u00a0geo-spatial coordinates. The scalar data type was never a data structure of R.\u00c2\u00a0Instead, a scalar is represented as a vector with length one.<\/p>\n<p>Many features of R derive from\u00c2\u00a0Scheme. R uses\u00c2\u00a0S-expressions\u00c2\u00a0to represent both data and code. Functions are\u00c2\u00a0first-class\u00c2\u00a0and can be manipulated in the same way as data objects, facilitating\u00c2\u00a0meta-programming, and allow\u00c2\u00a0multiple dispatch. Variables in R are\u00c2\u00a0lexically scoped\u00c2\u00a0and\u00c2\u00a0dynamically typed. Function arguments are passed by value, and are\u00c2\u00a0lazy\u00e2\u20ac\u201dthat is to say, they are only evaluated when they are used, not when the function is called.<\/p>\n<p>R supports\u00c2\u00a0procedural programming\u00c2\u00a0with\u00c2\u00a0functions\u00c2\u00a0and, for some functions,\u00c2\u00a0object-oriented programming\u00c2\u00a0with\u00c2\u00a0generic functions. A generic function acts differently depending on the\u00c2\u00a0classes\u00c2\u00a0of arguments passed to it. In other words, the generic function\u00c2\u00a0dispatches\u00c2\u00a0the function (method) specific to that\u00c2\u00a0class\u00c2\u00a0of\u00c2\u00a0object. For example, R has a\u00c2\u00a0generic\u00c2\u00a0<code>print<\/code>\u00c2\u00a0function that can print almost every\u00c2\u00a0class\u00c2\u00a0of\u00c2\u00a0object\u00c2\u00a0in R with a simple\u00c2\u00a0<code>print(objectname)<\/code>\u00c2\u00a0syntax.<\/p>\n<p>Although used mainly by statisticians and other practitioners requiring an environment for statistical computation and software development, R can also operate as a\u00c2\u00a0general matrix calculation\u00c2\u00a0toolbox \u00e2\u20ac\u201c with performance benchmarks comparable to\u00c2\u00a0GNU Octave\u00c2\u00a0or\u00c2\u00a0MATLAB.<\/p>\n<p>The main R implementation is written in R, C, and Fortran,\u00c2\u00a0and there are several other implementations aimed at improving speed or increasing extensibility. A closely related implementation is pqR (pretty quick R) by\u00c2\u00a0Radford M. Neal\u00c2\u00a0with improved memory management and support for automatic multithreading.\u00c2\u00a0Renjin\u00c2\u00a0and FastR are\u00c2\u00a0Java\u00c2\u00a0implementations of R for use in a Java Virtual Machine. CXXR, rho, and Riposte\u00c2\u00a0are implementations of R in\u00c2\u00a0C++. Renjin, Riposte, and pqR attempt to improve performance by using multiple processor cores and some form of deferred evaluation.\u00c2\u00a0Most of these alternative implementations are experimental and incomplete, with relatively few users, compared to the main implementation maintained by the R Development Core Team.<\/p>\n<p>TIBCO built a\u00c2\u00a0runtime engine\u00c2\u00a0called TERR, which is part of Spotfire.<\/p>\n<p>Microsoft R Open\u00c2\u00a0is a fully compatible R distribution with modifications for multi-threaded computations.<\/p>\n<p>R has local communities worldwide for users to network, share ideas, and learn.<\/p>\n<p>There is a growing number of R events bringing its users together, such as conferences (e.g. useR!, WhyR?, conectaR, SatRdays),\u00c2\u00a0meetups,\u00c2\u00a0as well as R-Ladies\u00c2\u00a0groups that promote gender diversity.<\/p>\n<p>The above is a brief about R Programming Language. Watch this space for more updates on the latest trends in Technology.<\/p>\n<p>&nbsp;<\/p>\n<div class=\"mw-highlight mw-content-ltr\" dir=\"ltr\"><\/div>\n","protected":false},"excerpt":{"rendered":"<p>R\u00c2\u00a0is a\u00c2\u00a0programming language\u00c2\u00a0and\u00c2\u00a0free software\u00c2\u00a0environment for\u00c2\u00a0statistical<\/p>\n","protected":false},"author":1,"featured_media":956,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[154,533,7],"tags":[156,534,18],"class_list":["post-954","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-programming-language","category-r","category-techtrends","tag-programming-language","tag-r","tag-technology"],"_links":{"self":[{"href":"https:\/\/blog.amt.in\/index.php\/wp-json\/wp\/v2\/posts\/954","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.amt.in\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.amt.in\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.amt.in\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.amt.in\/index.php\/wp-json\/wp\/v2\/comments?post=954"}],"version-history":[{"count":1,"href":"https:\/\/blog.amt.in\/index.php\/wp-json\/wp\/v2\/posts\/954\/revisions"}],"predecessor-version":[{"id":955,"href":"https:\/\/blog.amt.in\/index.php\/wp-json\/wp\/v2\/posts\/954\/revisions\/955"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.amt.in\/index.php\/wp-json\/wp\/v2\/media\/956"}],"wp:attachment":[{"href":"https:\/\/blog.amt.in\/index.php\/wp-json\/wp\/v2\/media?parent=954"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.amt.in\/index.php\/wp-json\/wp\/v2\/categories?post=954"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.amt.in\/index.php\/wp-json\/wp\/v2\/tags?post=954"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}