

{"id":4513,"date":"2017-10-16T06:47:21","date_gmt":"2017-10-16T06:47:21","guid":{"rendered":"http:\/\/data-flair.training\/blogs\/?p=4513"},"modified":"2021-08-25T17:26:28","modified_gmt":"2021-08-25T11:56:28","slug":"r-interview-questions","status":"publish","type":"post","link":"https:\/\/data-flair.training\/blogs\/r-interview-questions\/","title":{"rendered":"125 R Interview Questions and Answers For Freshers &amp; Experienced"},"content":{"rendered":"<h2>1. R Interview Questions and Answers<\/h2>\n<p>In our previous <a href=\"http:\/\/data-flair.training\/blogs\/category\/r\/\"><strong>R blog<\/strong><\/a>, we have discussed all the topics related to R Programming in detail. In this blog, we are going to provide you a top R Interview Questions and Answers. Here we will discuss the top 125 R Interview Questions and Answers for both Freshers and Experienced. Links are also provided along with the questions to the deep understanding of the topic. Hope this blog will help you a lot to crack R Interview. Happy Job Hunting:-)<\/p>\n<div id=\"attachment_42608\" style=\"width: 1210px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/10\/r-interview-questions-and-answers-2.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-42608\" class=\"size-full wp-image-42608\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/10\/r-interview-questions-and-answers-2.jpg\" alt=\"125 R Interview Questions and Answers For Freshers &amp; Experienced\" width=\"1200\" height=\"628\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/10\/r-interview-questions-and-answers-2.jpg 1200w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/10\/r-interview-questions-and-answers-2-150x79.jpg 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/10\/r-interview-questions-and-answers-2-300x157.jpg 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/10\/r-interview-questions-and-answers-2-768x402.jpg 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/10\/r-interview-questions-and-answers-2-1024x536.jpg 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/10\/r-interview-questions-and-answers-2-520x272.jpg 520w\" sizes=\"auto, (max-width: 1200px) 100vw, 1200px\" \/><\/a><p id=\"caption-attachment-42608\" class=\"wp-caption-text\">125 R Interview Questions and Answers For Freshers &amp; Experienced<\/p><\/div>\n<h2>2. Frequently Asked R Interview Questions and Answers<\/h2>\n<p><strong>Q.1. Explain What is R?\u00a0<\/strong><br \/>\n<strong>R<\/strong> is a language and environment for statistical computing and graphics. It is an open source programming language. R provides a wide variety of statistical and graphical techniques and is highly extensible. Data miners use it for developing statistical software and data analysis. One of the R\u2019s strengths is the ease with which well-designed publication-quality plots can be produced, including mathematical symbols and formulae where needed. R is available as Free Software under the terms of the Free Software Foundation\u2019s GNU General Public License in source code form. It compiles and runs on a wide variety of UNIX platforms and similar systems (including FreeBSD and Linux), Windows and MacOS. The R command line interface(CLI) consist of a prompt, usually the &gt; character.<br \/>\n<a href=\"http:\/\/data-flair.training\/blogs\/r-programming-tutorial\/\">Read more about R Programming in detail.<\/a><\/p>\n<div id=\"attachment_4717\" style=\"width: 778px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/What-is-R-1.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-4717\" class=\"wp-image-4717 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/What-is-R-1.jpg\" alt=\"R Interview Questions and Answers\" width=\"768\" height=\"426\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/What-is-R-1.jpg 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/What-is-R-1-150x83.jpg 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/What-is-R-1-300x166.jpg 300w\" sizes=\"auto, (max-width: 768px) 100vw, 768px\" \/><\/a><p id=\"caption-attachment-4717\" class=\"wp-caption-text\">R Interview Questions and Answers &#8211; Q.1<\/p><\/div>\n<p><strong>Q.2. What is GUI in R?<\/strong><br \/>\nGUI stands for <strong>Graphical User Interfaces<\/strong>. R is a command line driven program. The user enters commands at the prompt ( &gt; by default ) and each command is executed one at a time. There have been a number of attempts to create a more graphical interface, ranging from code editors that interact with R, to full-blown GUIs that present the user with menus and dialog boxes.<br \/>\n<a href=\"http:\/\/data-flair.training\/blogs\/r-programming-tutorial\/\">Read more about R Programming in detail.<\/a><br \/>\n<strong>Q.3. What is CLI in R?<\/strong><br \/>\n<strong>CLI<\/strong> stands for <strong>Command Line Interface<\/strong>. In a command line interface, you type commands that you want to execute and press return. For example, if you type the line 2+2 and press the return key, R will give you the result [1] 4<br \/>\n<strong>Q.4. What is data mining and what data miners do in R?<\/strong><br \/>\nR and Data Mining introduces researchers, post-graduate students, and analysts to data mining using R, a free software environment for statistical computing and graphics.<br \/>\n<strong>Q.5. Who and When R discovered?<\/strong><br \/>\nR was created by Ross Ihaka and Robert Gentleman at the University of Auckland, New Zealand, and is currently developed by the R Development Core Team, of which Chambers is a member. R is named partly after the first names of the first two R authors and partly as a play on the name of S.The project was conceived in 1992, with an initial version released in 1995 and a stable beta version in 2000.<\/p>\n<div id=\"attachment_4716\" style=\"width: 571px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/R.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-4716\" class=\"wp-image-4716 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/R.jpg\" alt=\"R interview Questions and Answers - R Discovery\" width=\"561\" height=\"218\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/R.jpg 561w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/R-150x58.jpg 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/R-300x117.jpg 300w\" sizes=\"auto, (max-width: 561px) 100vw, 561px\" \/><\/a><p id=\"caption-attachment-4716\" class=\"wp-caption-text\">R interview Questions and Answers &#8211; R Discovery<\/p><\/div>\n<p><strong>Q.6. Why should you adopt R programming language?<\/strong><\/p>\n<ul>\n<li>R programming language is best for statistical, data analysis and machine learning. By using this language we can create objects, functions, and packages.R is an open source programming language.<\/li>\n<li>By using R we can create any form of statistics and data manipulation. Furthermore, it can be used in almost every field of finance, marketing, sports etc. R Programming is extensible and hence, R groups are noted for its energetic contributions.<\/li>\n<li>Lots of Rs typical features can be written in R itself and hence, R has gotten faster over time and serves as a glue language.<\/li>\n<\/ul>\n<div id=\"attachment_4718\" style=\"width: 498px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/Why-Should-You-Adopt-R-Programming-language-01.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-4718\" class=\"wp-image-4718 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/Why-Should-You-Adopt-R-Programming-language-01.jpg\" alt=\"Why R - R interview Questions and Answers\" width=\"488\" height=\"420\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/Why-Should-You-Adopt-R-Programming-language-01.jpg 488w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/Why-Should-You-Adopt-R-Programming-language-01-150x129.jpg 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/Why-Should-You-Adopt-R-Programming-language-01-300x258.jpg 300w\" sizes=\"auto, (max-width: 488px) 100vw, 488px\" \/><\/a><p id=\"caption-attachment-4718\" class=\"wp-caption-text\">Why R &#8211; R interview Questions and Answers<\/p><\/div>\n<p><a href=\"http:\/\/data-flair.training\/blogs\/why-you-should-learn-r-programming\/\">Read more reasons to learn R Programming.<\/a><br \/>\n<strong>Q.7. What are programming features of R?<\/strong><\/p>\n<ul>\n<li>Packages are part of R programming. Hence, they are useful in collecting sets of R functions into<br \/>\na single unit.<\/li>\n<li>R&#8217;s programming features include database input, exporting data, viewing data, variable labels,<br \/>\nmissing data, etc.<\/li>\n<li>R is an interpreted language. So we can access it through command line interpreter.<\/li>\n<li>R supports matrix arithmetic.<\/li>\n<li>R supports procedural programming with functions and object-oriented programming with<br \/>\ngeneric functions. Procedural programming includes procedure, records, modules, and<br \/>\nprocedure calls while object-oriented programming language includes class, objects, and<br \/>\nfunctions.<\/li>\n<\/ul>\n<div id=\"attachment_4715\" style=\"width: 510px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/Programming-features-of-R-01.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-4715\" class=\"wp-image-4715 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/Programming-features-of-R-01.jpg\" alt=\"R Interview Questions - R Programming Features\" width=\"500\" height=\"420\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/Programming-features-of-R-01.jpg 500w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/Programming-features-of-R-01-150x126.jpg 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/Programming-features-of-R-01-300x252.jpg 300w\" sizes=\"auto, (max-width: 500px) 100vw, 500px\" \/><\/a><p id=\"caption-attachment-4715\" class=\"wp-caption-text\">R Interview Questions &#8211; R Programming Features<\/p><\/div>\n<p><strong>Q.8. What are the applications of R?<\/strong><\/p>\n<ul>\n<li>Many data analysts and research programmers use R because R is the most prevalent language. Hence, R is used as a fundamental tool for finance.<\/li>\n<li>Many quantitative analysts use R as their programming tool. Hence, R helps in data importing and cleaning, depending on what manner of strategy you are using on.<\/li>\n<li>R is best for data Science because it gives a broad variety of statistics. In addition, R provides the environment for statistical computing and design. Rather R considers as an alternate execution of S.\n<p><div id=\"attachment_4712\" style=\"width: 510px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/Applications-of-R-01.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-4712\" class=\"wp-image-4712 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/Applications-of-R-01.jpg\" alt=\"R interview Questions and Answers - R Applications\" width=\"500\" height=\"420\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/Applications-of-R-01.jpg 500w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/Applications-of-R-01-150x126.jpg 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/Applications-of-R-01-300x252.jpg 300w\" sizes=\"auto, (max-width: 500px) 100vw, 500px\" \/><\/a><p id=\"caption-attachment-4712\" class=\"wp-caption-text\">R interview Questions and Answers &#8211; R Applications<\/p><\/div><\/li>\n<\/ul>\n<p><a href=\"http:\/\/data-flair.training\/blogs\/r-programming-tutorial\/\">Learn More R Applications in detail.<\/a><br \/>\n<strong>Q.9. Compare R with other technologies.<\/strong><\/p>\n<ul>\n<li><strong>Data handling Capabilities &#8211;<\/strong> Good data handling capabilities and options for parallel computation.<\/li>\n<li><strong>Availability \/ Cost &#8211;<\/strong> R is an open source and we can use it anywhere.<\/li>\n<li><strong>Advancement in Tool &#8211;<\/strong>\u00a0 if you are working on latest technologies, R gets latest features.<\/li>\n<li><strong>Ease of Learning &#8211;<\/strong> R has a learning curve. R is a low-level programming language. As a result, simple procedures can take long codes.<\/li>\n<li><strong>Job Scenario &#8211;<\/strong> It is a better option for start-ups and companies looking for cost efficiency.<\/li>\n<li><strong>Graphical capabilities &#8211;<\/strong> R is having the most advanced graphical capabilities. Hence, it provides us advanced graphical capabilities.<\/li>\n<li><strong>Customer Service support and community &#8211;<\/strong> R is the biggest online growing community.<\/li>\n<\/ul>\n<p><strong>Q.10. Why is R Important?<\/strong><br \/>\nR is a leading tool for <a href=\"http:\/\/data-flair.training\/blogs\/machine-learning-tutorial\/\"><strong>machine learning<\/strong><\/a>, statistics, and data analysis. It is a programming language. By using R we can create objects, functions, and packages. R language is a platform independent so we can use it on any operating systems. The installation of R is free so we can use it without purchasing a license. R is not only statistic package and is an open source. It means anyone can examine the source code to see what exactly is doing on screen. Anyone can add a feature and fix bugs without waiting for the vendor to do this. Thus, it allows you to integrate with other languages (C, C++). It also enables you to interact with many data sources and statistical packages (SAS, SPSS). R has large growing community of users.<\/p>\n<h2>Basic R Interview Questions and Answers<\/h2>\n<p><strong>Q.11. Is R is a slow language?<\/strong><\/p>\n<ul>\n<li>R programs can be slow, but well-written R programs are usually fast enough.<\/li>\n<li>Speed was not the primary design criteria.<\/li>\n<li>Designed to make programming easier.<\/li>\n<li>Slow programs often a result of bad programming practices or not<br \/>\nunderstanding how R works.<\/li>\n<li>There are various options for calling C or C++ functions from R.<\/li>\n<\/ul>\n<p><strong>Q.12. Explain main features to write R code that runs faster?<\/strong><br \/>\nR is a popular statistical software which is famous for the enormous amount of packages. R\u2019s syntax is very flexible with making it convenient at the cost of performance. R is indeed slow compared to many other scripting languages, but there are a few tricks which can make our R code run faster.<\/p>\n<ul>\n<li>Use matrix instead of data frame whenever possible. Actually data frame cause problem in many cases. Only use data frame when necessary.<\/li>\n<li>Use double(n) to create a vector of length n instead of using code rep(0,n), and similar to others.<\/li>\n<li>Split big data object (e.g., big data frame or matrix) to smaller ones, and operate on these smaller objects.<\/li>\n<li>Use for each(i=1:n) %dopar% {} to do parallel computing if applicable. Even if a for loop is not parallelizable, for each(i=1:n) %do% {} is a better alternative.<\/li>\n<li>Use vector and matrix operation if possible. Theses *apply functions are very helpful for this purpose.<\/li>\n<li>Avoid changing the type and size of an object in R. Though we use R object as if they are typeless, they have type actually. In R, changing the type and size of an R object forces it to reallocate a memory space which is of course insufficient.<\/li>\n<li>Avoid creating too many objects in each working environment. Not having enough memory can not only make your code run slower but also make it fail to run if have to allocate big vectors. One way to do this is to write small functions and run your functions instead of running everything directly in a working environment.<\/li>\n<\/ul>\n<p><strong>Q.13. What is SAS and SPSS in R?<\/strong><br \/>\nSAS stands for <strong>Statistical Analysis System<\/strong>. It was primarily developed to be able to analyze large quantities of agriculture data while SPSS stands for Statistical Package for the Social Sciences and was developed for the social sciences and was the first statistical programming language for the PC.<br \/>\n<strong>Q.14. Why is R important for data science?<\/strong><\/p>\n<ul>\n<li>We can run your code without any Compiler &#8211; R is an interpreted language. Hence we can run Code without any compiler. R interprets the Code and makes the development of code easier.<\/li>\n<li>Many calculations done with vectors &#8211; R is a vector language, so anyone can add functions to a single Vector without putting in a loop. Hence, R is powerful and faster than other languages.<\/li>\n<li>Statistical Language- R used in biology, genetics as well as in statistics. R is a turning complete<br \/>\na language where any type of task can be performed.<\/li>\n<\/ul>\n<p><strong>Q.15. Why is R Good for business?<\/strong><\/p>\n<ul>\n<li>The most important reason why R is good for business is that it is an open source. R is great for visualization. As per new research, R has far more capabilities as compared to earlier tools.<\/li>\n<li>For data-driven business, data science talent shortage is a very big problem. Companies are<br \/>\nusing R programming as their platform and recruit trained users of R.<\/li>\n<\/ul>\n<p><strong>Q.16. What is Visualization in R?<\/strong><br \/>\nVisualization is any technique for creating images, diagrams, or animations to communicate a message. Visualization through visual imagery has been an effective way to communicate both abstract and concrete ideas since the dawn of humanity.<br \/>\n<strong>Q.17. What are R topical programming and statistical relevance?<\/strong><br \/>\n<strong>a) Statistical<\/strong><\/p>\n<ul>\n<li>R is free, open source software.<\/li>\n<li>R is available from free software Foundation.<\/li>\n<\/ul>\n<p><strong>b) Programming<\/strong><\/p>\n<ul>\n<li>Data inputs such as data type, importing data, keyboard typing.<\/li>\n<li>Data Management such as data variables, operators.<\/li>\n<\/ul>\n<p><strong>Q.18. What are statistical and programming features of R?<\/strong><\/p>\n<div id=\"attachment_4720\" style=\"width: 590px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/statistical-and-programming-features-of-R.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-4720\" class=\"wp-image-4720 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/statistical-and-programming-features-of-R.jpg\" alt=\"R Interview Questions and answers\" width=\"580\" height=\"420\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/statistical-and-programming-features-of-R.jpg 580w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/statistical-and-programming-features-of-R-150x109.jpg 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/statistical-and-programming-features-of-R-300x217.jpg 300w\" sizes=\"auto, (max-width: 580px) 100vw, 580px\" \/><\/a><p id=\"caption-attachment-4720\" class=\"wp-caption-text\">R Interview Questions and answers<\/p><\/div>\n<p><strong>a) Statistical Features-<\/strong><\/p>\n<ul>\n<li><strong>Basic Statistics:<\/strong> Mean, variance, median.<\/li>\n<li><strong>Static graphics:<\/strong> Basic plots, graphic maps.<\/li>\n<li><strong>Probability distributions:<\/strong> Beta, Binomial.<\/li>\n<\/ul>\n<p><strong>b) Programming Features- <\/strong><\/p>\n<ul>\n<li><strong>Distributed Computing:<\/strong> Distributed computing is an open source, high-performance platform for the R language. It splits tasks between multiple processing nodes to reduce execution time and analyze large datasets.<\/li>\n<li><strong>R packages &#8211;<\/strong> R packages are a collection of R functions, compiled code and sample data. By default, R installs a set of packages during installation.<\/li>\n<\/ul>\n<p><strong>Q.19. What are the advantages of R?<\/strong><\/p>\n<ul>\n<li>R is the most comprehensive statistical analysis package as new technology and ideas often appear first in R.<\/li>\n<li>R is open-source software. Hence anyone can use and\u00a0change it.<\/li>\n<li>R is an open source. We can run R anywhere and at any time, and even sell it under conditions of the license.<\/li>\n<li>R is good for GNU\/Linux and Microsoft Windows. R is cross-platform which runs on many operating systems.<\/li>\n<li>In R, anyone is welcome to provide bug fixes, code enhancements, and new packages.<\/li>\n<\/ul>\n<div id=\"attachment_4721\" style=\"width: 640px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/Advantages-of-R.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-4721\" class=\"wp-image-4721 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/Advantages-of-R.jpg\" alt=\"Advantages of R - R programming interview questions\" width=\"630\" height=\"200\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/Advantages-of-R.jpg 630w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/Advantages-of-R-150x48.jpg 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/Advantages-of-R-300x95.jpg 300w\" sizes=\"auto, (max-width: 630px) 100vw, 630px\" \/><\/a><p id=\"caption-attachment-4721\" class=\"wp-caption-text\">Advantages of R &#8211; R programming interview questions<\/p><\/div>\n<p><strong>Q.20. What are the disadvantages of R?<\/strong><\/p>\n<ul>\n<li>In R, quality of some packages is less than perfect.<\/li>\n<li>In R, no one to complain, if something doesn\u2019t work.<\/li>\n<li>R is a software Application that many people devote their own time to developing.<\/li>\n<li>R commands give little thought to memory management, and so R can consume all available memory.<\/li>\n<\/ul>\n<div id=\"attachment_4722\" style=\"width: 590px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/Disadvantages-of-R.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-4722\" class=\"wp-image-4722 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/Disadvantages-of-R.jpg\" alt=\"Disadvantages of r - r programming questions and answers\" width=\"580\" height=\"365\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/Disadvantages-of-R.jpg 580w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/Disadvantages-of-R-150x94.jpg 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/Disadvantages-of-R-300x189.jpg 300w\" sizes=\"auto, (max-width: 580px) 100vw, 580px\" \/><\/a><p id=\"caption-attachment-4722\" class=\"wp-caption-text\">Disadvantages of r &#8211; r programming questions and answers<\/p><\/div>\n<h2>R interview Questions For Freshers<\/h2>\n<p><strong>Q.21. Why R language?<\/strong><\/p>\n<ul>\n<li>In R, quality of some packages is less than perfect.<\/li>\n<li>In R, no one to complain, if something doesn\u2019t work.<\/li>\n<li>R is a software Application that many people devote their own time to developing.<\/li>\n<li>R commands give little thought to memory management, and So R can consume all available memory.<\/li>\n<\/ul>\n<p><strong>Q.22. What is Predictive Analysis in R?<\/strong><br \/>\nPredictive analysis is the branch of advanced analysis. It used to make predictions about unknown future events. The Predictive analysis contains data collection, statistics, and deployment. It uses many techniques from data mining, statistics, machine learning and analyzes current data to make predictions about future. It also allows the business users to create Predictive intelligence.<br \/>\n<a href=\"http:\/\/data-flair.training\/blogs\/r-predictive-and-descriptive-analytics\/\">Learn about R predictive Analysis in detail.<\/a><br \/>\n<strong>Q.23. What is Predictive analysis process in R?<\/strong><\/p>\n<ul>\n<li><strong>Define Project &#8211;\u00a0<\/strong>It includes Project outcomes, business objectives, deliverables, scoping of the effects.<\/li>\n<li><strong>Data Collection &#8211;<\/strong> For predictive analysis, it collects data from different sources to analysis. Thus it provides a complete view of customer interactions.<\/li>\n<li><strong>Data Analysis &#8211;<\/strong> It is the process of cleaning, transforming, inspecting and modeling data. The goal of this process is to discover useful information.<\/li>\n<li><strong>Statistics &#8211;<\/strong> This process enables to confirm the assumptions. Hence it uses the assumption to test using a statistical model.<\/li>\n<li><strong>Modeling &#8211;<\/strong> An accurate predictive model about future is been created using predictive modeling. There are also options to choose the best model.<\/li>\n<li><strong>Deployment &#8211;<\/strong> To deploy the analytical results into everyday decision-making.<\/li>\n<li><strong>Model Monitoring &#8211;<\/strong> To ensure that it is providing an expected result, we have to manage model.<\/li>\n<\/ul>\n<div id=\"attachment_4714\" style=\"width: 510px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/Predictive-analysis-processBlock-diagram.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-4714\" class=\"wp-image-4714 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/Predictive-analysis-processBlock-diagram.jpg\" alt=\"Predictive analysis process in R - r language interview questions\" width=\"500\" height=\"420\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/Predictive-analysis-processBlock-diagram.jpg 500w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/Predictive-analysis-processBlock-diagram-150x126.jpg 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/Predictive-analysis-processBlock-diagram-300x252.jpg 300w\" sizes=\"auto, (max-width: 500px) 100vw, 500px\" \/><\/a><p id=\"caption-attachment-4714\" class=\"wp-caption-text\">Predictive analysis process in R &#8211; r language interview questions<\/p><\/div>\n<p><strong>Q.24. What is the need for Predictive Analysis in R?<\/strong><\/p>\n<ul>\n<li>Secure a competitive Stronghold It helps you to play your competitors\u2019 weaknesses and company\u2019s strengths.\u00a0Hence, it allows you to check the actions of consumers and your competitors\u2019 marketing and sales.<\/li>\n<li>Do more than evaluating the past Employee analysis helps to check your company details. It will summarize past failure or past success. Therefore, the most important thing is that predictive analysis helps in learning from past experiences.<\/li>\n<li>Maintain business integrity by managing fraud, First of all, Fraud investigators can look into only a set number of cases each week. Secondly, they\u00a0use company\u2019s past experience to score transactions according to their level of risk.<\/li>\n<li>Advance your core business Capability The next step to growth is to improve company core offering. Thus At its core, it focuses on using it to optimize your approach to the market.<\/li>\n<\/ul>\n<p><strong>Q.25. What is Descriptive analysis in R?<\/strong><br \/>\nIt does exactly what the name Implies \u201cDescribe\u201d. it allows us to learn from our past and to understand how they might influence future outcomes. The main goal of is to find out the reasons behind previous success or failure in the past. Hence, Most of the social analysis is descriptive analysis. For Example &#8211; the company\u2019s production, financials, operations, sales, finance, inventory, and customers.<br \/>\n<a href=\"http:\/\/data-flair.training\/blogs\/r-predictive-and-descriptive-analytics\/\">Learn more about R Descriptive Analysis in detail.<\/a><br \/>\n<strong>Q.26. What are Descriptive analysis methods in R?<\/strong><\/p>\n<ul>\n<li><strong>Observation Method &#8211;<\/strong> There are two ways to draw the meaningful conclusion: Artificial &amp; Natural.<\/li>\n<li><strong>Survey Method &#8211;<\/strong> In this method, questionnaires prepares and given to the participants. Hence After receiving the answers, the research preceded and results concluded.<\/li>\n<li><strong>Case Method &#8211;<\/strong> It involves a deep study of all the problems discussed. Thus, it makes us understand a particular situation.<\/li>\n<\/ul>\n<div id=\"attachment_4713\" style=\"width: 510px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/Descriptive-Analysis-Methods.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-4713\" class=\"wp-image-4713 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/Descriptive-Analysis-Methods.jpg\" alt=\"Descriptive analysis methods in R\" width=\"500\" height=\"420\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/Descriptive-Analysis-Methods.jpg 500w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/Descriptive-Analysis-Methods-150x126.jpg 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/Descriptive-Analysis-Methods-300x252.jpg 300w\" sizes=\"auto, (max-width: 500px) 100vw, 500px\" \/><\/a><p id=\"caption-attachment-4713\" class=\"wp-caption-text\">Descriptive analysis methods in R<\/p><\/div>\n<p><strong>Q.27. What is R studio and how to use it?<\/strong><br \/>\n<strong>a) USING RSTUDIO<\/strong><\/p>\n<ul>\n<li><strong>step 1:\u00a0<\/strong>Download and install Rstudio.<\/li>\n<li><strong>step 2:\u00a0<\/strong>Open RStudio and do this:<\/li>\n<li><strong>step 3:\u00a0<\/strong>Click on the menu: File -&gt; New -&gt; R Script<\/li>\n<li><strong>step 4:\u00a0<\/strong>Paste the code in the new source code area<\/li>\n<li><strong>step 5:\u00a0<\/strong>Click the &#8220;Source&#8221; button above the code area:<\/li>\n<\/ul>\n<p>We can also use the console in RStudio. If we click &#8220;Run&#8221; instead of &#8220;Source&#8221; user input might not work properly. We can use the R documentation like this: help(function.name).<\/p>\n<ul>\n<li><strong>Using the R console &#8211;<\/strong> Running the r program on the command line or elsewhere will start the console. we can paste your code there.<\/li>\n<li><strong>Problems with this approach &#8211;<\/strong> If we use source(\u201cfilename.r\u201d) to run your code then it will surely work. But If we paste the code some of it might be read as user input.<\/li>\n<li><strong>Running a source file with R &#8211;<\/strong> We can run a source file like this: r -f filename.r.<br \/>\nR also provides a lot of other command line arguments<\/li>\n<\/ul>\n<p><a href=\"http:\/\/data-flair.training\/blogs\/r-programming-tutorial\/\">Learn about R Studio in detail.<\/a><br \/>\n<strong>Q.28. What are R data types?<\/strong><br \/>\nIn programming, a data type is a classification that specifies what type of a value variable has. It also describes what type of relational, mathematical and logical operations can apply to it without causing an error. We need to use various variables to store information while doing programming in any programming language. Variables are nothing but reserved memory locations to store values. This means that when we create a variable we reserve some space in memory. The variables are assigned with R-Objects. Thus, the data type of the R-object becomes the data type of the variable.<br \/>\n<a href=\"http:\/\/data-flair.training\/blogs\/r-data-types\/\">Read about R Data Types in detail.<\/a><br \/>\n<strong>Q.29. How many types of data types are provided by R?<\/strong><br \/>\nThere are 5 types of data types present in R:<\/p>\n<ul>\n<li>Integer data type<\/li>\n<li>Numeric data type<\/li>\n<li>Character data type<\/li>\n<li>Complex data type<\/li>\n<li>Logical data type<\/li>\n<\/ul>\n<div id=\"attachment_4735\" style=\"width: 417px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/Types-of-Data-Types-Provided-by-R.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-4735\" class=\"wp-image-4735 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/Types-of-Data-Types-Provided-by-R.jpg\" alt=\"Data Types - R questions and answers\" width=\"407\" height=\"314\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/Types-of-Data-Types-Provided-by-R.jpg 407w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/Types-of-Data-Types-Provided-by-R-150x116.jpg 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/Types-of-Data-Types-Provided-by-R-300x231.jpg 300w\" sizes=\"auto, (max-width: 407px) 100vw, 407px\" \/><\/a><p id=\"caption-attachment-4735\" class=\"wp-caption-text\">Data Types &#8211; R questions and answers<\/p><\/div>\n<p><strong>Q.30. What is the main difference between an Array and a matrix?<\/strong><br \/>\nA matrix is always two dimensional as it has only rows and columns. But an array can be of any number of dimensions and each dimension is a matrix. For example, a 3x3x2 array represents 2 matrices each of dimension 3&#215;3.<br \/>\n<strong>Q.31. What is R vector?<\/strong><br \/>\nThe basic data structure in R is the vector. It comes in two parts: atomic vectors and lists. They have three common properties:<\/p>\n<ul>\n<li>Type function, what it is?<\/li>\n<li>Length function, how many elements it contains.<\/li>\n<li>Attribute function, extra arbitrary metadata. They differ in the types of their elements: All elements of an atomic vector must be the same type, whereas the elements of a list can have different types.<\/li>\n<\/ul>\n<p><a href=\"http:\/\/data-flair.training\/blogs\/r-vector-types-and-operations\/\">Learn R Vectors in detail.<\/a><br \/>\n<strong>Q.32. How many types of vectors are present in R?<\/strong><\/p>\n<ul>\n<li>Atomic Vector<\/li>\n<li>Combining Vector<\/li>\n<li>Vector arithmetic<\/li>\n<li>Logical index vector<\/li>\n<li>Numeric index<\/li>\n<li>Duplicate Index<\/li>\n<li>Range Indexes<\/li>\n<li>Out-of-order Indexes<\/li>\n<li>named Vectors Members<\/li>\n<\/ul>\n<p><strong>Q.33. What is an Atomic vector and how many types of atomic vectors are present in R?<\/strong><br \/>\nThe atomic vector is the simplest R data type. Atomic vectors are linear vectors of a single primitive type, like an STL Vector in C++. There are four types of atomic vectors are present in R:<\/p>\n<ul>\n<li>Numerical datatype<\/li>\n<li>Integer datatype<\/li>\n<li>Character datatype<\/li>\n<li>Logical datatype<\/li>\n<\/ul>\n<p><strong>Q.34. What is recycling of elements in an R vector? Give an example.<\/strong><br \/>\nWhen two vectors of different length are involved in an operation then the elements of the shorter vector are reused to complete the operation. This is called element recycling.<br \/>\n<strong>Example &#8211;<\/strong> v1 &lt;- c(4,1,0,6) and v2 &lt;- c(2,4) then v1*v2 gives (8,4,0,24). The elements 2 and 4 are repeated.<br \/>\n<strong>Q.35. What is R lists?<\/strong><br \/>\nLists are the object which Contains elements of different types \u2013 like strings, numbers, vectors and another list inside it. A list can also contain a matrix or a function as its elements. The List is created using list() Function. In other words, a list is a generic vector containing other objects. For Example, The variable x is containing copies of three vectors n, s, b and a numeric value 3.<br \/>\nn = c(2, 3, 5)<br \/>\ns =\u00a0 c(\u201caa\u201d,\u00a0 \u201cbb\u201d,\u00a0 \u201ccc\u201d,\u00a0 \u201cdd\u201d, \u201cee\u201d )<br \/>\nb = c(TRUE,\u00a0 FALSE,\u00a0 TRUE,\u00a0 FALSE,\u00a0 FALSE )<br \/>\nx = list( n, s, b, 3)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0# x contains copies of n, s, b)<br \/>\n<a href=\"http:\/\/data-flair.training\/blogs\/r-lists-tutorial\/\">Learn more about R Lists in detail.<\/a><br \/>\n<strong>Q.36. Explain how to create a list in R?<\/strong><br \/>\nCreate a list containing string, numbers, vectors and logical values. For Example:<br \/>\n[php]List_data &lt;- list(&#8220;Green&#8221;, &#8220;Yellow&#8221;, c(5,6,7), TRUE, 51.2)[\/php]<br \/>\nprint(list_data) When we execute the above code, it produces the following result-<br \/>\n[php][[1]]<br \/>\n[1] \u201cGreen\u201d<br \/>\n[[2]]<br \/>\n[1] \u201cYellow\u201d<br \/>\n[[3]]<br \/>\n[1] 5, 6, 7<br \/>\n[[4]]<br \/>\n[1] TRUE<br \/>\n[[5]]<br \/>\n[1] 51.2[\/php]<br \/>\n<strong>Q.37. Explain how to access list elements in R?<\/strong><br \/>\nCreate a list containing a vector, a list and a matrix.<br \/>\n[php]list_data &lt;- list(c(&#8220;Feb&#8221;,&#8221;Mar&#8221;,&#8221;Apr&#8221;))<br \/>\nlist(&#8220;white&#8221;,13.4)), matrix(c(3,9,5,1,-2,8), nrow = 2)[\/php]<br \/>\nFor Example: Give names to the elements in the list:<br \/>\n[php]Names(list_data) &lt;- c(\u201c1 st\u00a0 Quarter\u201d, \u201cA Matrix\u201d, \u201cA Inner list\u201d)[\/php]<br \/>\nAccess the first element of the list:<br \/>\n[php]print(list_data[1])[\/php]<br \/>\nAccess the third element. As it also a list, all its elements will print:<br \/>\n[php]Print(list_data[3])[\/php]<br \/>\nBy using the name of the element access the list elements:<br \/>\n[php]Print(list_data$A Matrix)[\/php]<br \/>\nIt will produced the following result after executing the above code:<br \/>\n[php]$\u201d1 st \u00a0Quarter\u201d [1] \u201cFeb\u201d, &#8220;Mar\u201d, &#8220;Apr\u201d<br \/>\n$A_Inner_list<br \/>\n$A_Inner_list[[1]]<br \/>\n[1] \u201cWhite\u201d<br \/>\n$A_Inner_list[[2]]<br \/>\n[1] 13.4<br \/>\n$ \u201cA Matrix\u201d [1]<br \/>\n[1]\u00a0 \u00a0[2]\u00a0 \u00a0[3]<br \/>\n[1] \u00a0 \u00a0 3 \u00a0 \u00a0 5\u00a0 \u00a0 -2<br \/>\n[2] \u00a0 \u00a0 9 \u00a0 \u00a0 1\u00a0 \u00a0 \u00a08[\/php]<br \/>\n<strong>Q.38. Explain how to manipulate list elements in R?<\/strong><br \/>\nCreate a list containing a vector, a matrix and a list.<br \/>\n[php]list_data &lt;- list(c(&#8220;Feb&#8221;,&#8221;Mar&#8221;,&#8221;Apr&#8221;),<br \/>\nmatrix(c(3,9,5,1,-2,8), nrow = 2), list(&#8220;green&#8221;,12.3))[\/php]<br \/>\nFor Example:<br \/>\nGive names to the elements in the list:<br \/>\n[php]names(list_data) &lt;- c(&#8220;1st Quarter&#8221;, &#8220;A_Matrix&#8221;, &#8220;A Inner list&#8221;)[\/php]<br \/>\nAdd element at the end of the list:<br \/>\n[php]list_data[4] &lt;- &#8220;New element&#8221;<br \/>\nprint(list_data[4])[\/php]<br \/>\nRemove the last element:<br \/>\n[php]list_data[4] &lt;- NULL\u00a0# Print the 4th Element.print(list_data[4])[\/php]<br \/>\nUpdate the 3rd Element:<br \/>\n[php]list_data[3] &lt;- &#8220;updated element&#8221;<br \/>\nprint(list_data[3])[\/php]<br \/>\nWhen we execute the above code, it produces the following result:<br \/>\n[php][[1]]<br \/>\n[1] &#8220;New element&#8221;<br \/>\n$NULL<br \/>\n$`A Inner list`<br \/>\n[1] &#8220;updated element&#8221;[\/php]<br \/>\n<strong>Q.39. Explain how to generate lists in R?<\/strong><br \/>\nWe can use a colon to generate a list of numbers. For\u00a0example:<br \/>\n[php]-3:3<br \/>\n[1] -3 -2 -1 0 1 2 3[\/php]<br \/>\n<strong>Q.40. Explain how to operate on lists in R?<\/strong><br \/>\nR allows to Operate on all list values at once. For example:<br \/>\n[php]c(1,3,5) + 4[\/php]<br \/>\nThis and the\u00a0Apply function\u00a0allow you to avoid most for loops.<br \/>\n[php][1] 5, 7, 9[\/php]<br \/>\n<strong>Q.41. Can we update and delete any of the elements in a list?<\/strong><br \/>\nWe can update any of the element but we can delete only the element at the end of the list.<br \/>\n<strong>Q.42. How many types of object are present In R?<\/strong><br \/>\nThere are 6 types of objects present in R:<\/p>\n<ul>\n<li>Vectors<\/li>\n<li>Matrices<\/li>\n<li>Arrays<\/li>\n<li>Lists<\/li>\n<li>Data Frames<\/li>\n<li>Factors<\/li>\n<\/ul>\n<div id=\"attachment_4731\" style=\"width: 365px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/types-of-objects-are-present-in-R.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-4731\" class=\"wp-image-4731 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/types-of-objects-are-present-in-R.jpg\" alt=\"r interview questions - Types of objects\" width=\"355\" height=\"378\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/types-of-objects-are-present-in-R.jpg 355w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/types-of-objects-are-present-in-R-141x150.jpg 141w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/types-of-objects-are-present-in-R-282x300.jpg 282w\" sizes=\"auto, (max-width: 355px) 100vw, 355px\" \/><\/a><p id=\"caption-attachment-4731\" class=\"wp-caption-text\">r interview questions &#8211; Types of objects<\/p><\/div>\n<p><strong>Q.43. What are R Functions?<\/strong><br \/>\nA function is a piece of code written to carry out a specified task. Thus it can or can\u2019t accept arguments or parameters and it can or can\u2019t return one or more values. In R, functions are objects in their own right. Hence, we can work with them exactly the same way we work with any other type of object.<br \/>\n<a href=\"http:\/\/data-flair.training\/blogs\/r-programming-functions\/\">learn more about R Functions in detail.<\/a><br \/>\n<strong>Q.44. What are features of R functions?<\/strong><br \/>\nFunction component describes the three main components of a function.<\/p>\n<ul>\n<li>Lexical scoping teaches how R finds values from names.<\/li>\n<li>In R, every operation is a function call.<\/li>\n<li>Function arguments discuss the three ways of supplying arguments to a function. it shows to call<\/li>\n<li>The function is given a list of arguments and to the impact of lazy evaluation.<\/li>\n<li>Special calls describe two special types of function infix and replacement functions.<\/li>\n<li>Return values discuss how and when functions return values. it also shows how you can ensure<br \/>\nthat a function does something before it exists.<\/li>\n<\/ul>\n<p><strong>Q.45. What is function definition?<\/strong><br \/>\nAn R function is been created using the keyword function. The basic syntax of an R function definition is as follows \u2212<br \/>\nfunction_name &lt;- function(arg_1, arg_2, &#8230;) {<br \/>\nFunction body<br \/>\n}<br \/>\n<strong>Q.46. What are the components of R functions?<\/strong><br \/>\nThe different parts of a function are \u2212<\/p>\n<ul>\n<li><strong>Function Name \u2212<\/strong>\u00a0It is the actual name of the function because it stored in R environment as an object with this name.<\/li>\n<li><strong>Arguments \u2212<\/strong>\u00a0An argument is a placeholder. When a function invokes, we pass a value to the<br \/>\nargument. Arguments are optional; that is, a function may contain no arguments. Also, arguments can have default values.<\/li>\n<li><strong>Functions Body \u2013<\/strong> In a function body, statements can be collected. and hence, it defines what the function does.<\/li>\n<li><strong>Return Value \u2212<\/strong> the return value of a function is the last expression in the function body to check.<\/li>\n<\/ul>\n<div id=\"attachment_4738\" style=\"width: 330px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/Components-of-R-functions-1.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-4738\" class=\"wp-image-4738 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/Components-of-R-functions-1.jpg\" alt=\"r programming interview questions - Components of R Functions\" width=\"320\" height=\"314\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/Components-of-R-functions-1.jpg 320w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/Components-of-R-functions-1-150x147.jpg 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/Components-of-R-functions-1-300x294.jpg 300w\" sizes=\"auto, (max-width: 320px) 100vw, 320px\" \/><\/a><p id=\"caption-attachment-4738\" class=\"wp-caption-text\">r programming interview questions &#8211; Components of R Functions<\/p><\/div>\n<p><strong>Q.47. What are Generic Functions in R?<\/strong><br \/>\nR has three object-oriented (OO) systems: [[S3]], [[S4]] and [[R5]]. &#8230; A method is a function associated with a particular type of object. S3 implements a style of object-oriented programming called generic-function OO.<br \/>\n<strong>Q.48. What are R packages?<\/strong><br \/>\nPackages are collections of <a href=\"http:\/\/data-flair.training\/blogs\/r-programming-functions\/\"><strong>R functions<\/strong><\/a>, data, and compiled code in a well-defined format. The directory where packages are stored is called the library. R comes with a standard set of packages. Others are available for download and installation. Once installed, they have to be loaded into the session to be used.<br \/>\n<a href=\"http:\/\/data-flair.training\/blogs\/r-packages-tutorial\/\">Learn more about R Packages in detail.<\/a><br \/>\n<strong>Q.49. Name the functions which helps in importing data from other applications in R?<\/strong><\/p>\n<ul>\n<li>read.table()<\/li>\n<li>readlines()<\/li>\n<li>read.fwf<\/li>\n<li>read.delim()<\/li>\n<li>scan()<\/li>\n<li>read.csv()<\/li>\n<li>read.csv2()<\/li>\n<\/ul>\n<div id=\"attachment_4770\" style=\"width: 330px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/Functions-help-in-importing-data.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-4770\" class=\"wp-image-4770 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/Functions-help-in-importing-data.jpg\" alt=\"Functions helps in importing the data - R interview questions\" width=\"320\" height=\"314\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/Functions-help-in-importing-data.jpg 320w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/Functions-help-in-importing-data-150x147.jpg 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/Functions-help-in-importing-data-300x294.jpg 300w\" sizes=\"auto, (max-width: 320px) 100vw, 320px\" \/><\/a><p id=\"caption-attachment-4770\" class=\"wp-caption-text\">Functions helps in importing the data &#8211; R interview questions<\/p><\/div>\n<h2>R Interview Questions for Experienced<\/h2>\n<p><strong>Q.50. What is more functions in R and name them?<\/strong><br \/>\nWe have to load the built-in foreign command to use these functions:<br \/>\n[php]&gt;library(&#8220;foreign&#8221;)[\/php]<br \/>\n<strong>R more functions:<\/strong><\/p>\n<ul>\n<li>read.xpss<\/li>\n<li>read.xport<\/li>\n<li>read.dta<\/li>\n<\/ul>\n<p><strong>Q.51. List out some of the function that R provides?<\/strong><\/p>\n<ul>\n<li>Mean<\/li>\n<li>Median<\/li>\n<li>Distribution<\/li>\n<li>Covariance<\/li>\n<li>Regression<\/li>\n<\/ul>\n<p><strong>Q.52. What is the distribution in R?<\/strong><br \/>\nR Functions for Probability Distributions. Every distribution that R handles has four functions. There is a root name, for example, the root name for the normal distribution is the norm. This root is prefixed by one of the letters. p for &#8220;probability&#8221;, the cumulative distribution function (c. d. f.)<br \/>\n<strong>Q.53. What are vector functions?<\/strong><br \/>\nIn R, a function is a piece of code written to carry out a specified task. R Functions are called as objects because we can work with them exactly the same way we work with any other type of object. Vector functions are those functions which we used in vectors.<br \/>\nFor Example: rep(), seq(), using all() and any(), more on c() etc.<br \/>\nMost common functions which we use in vector operations are &#8211;<\/p>\n<ul>\n<li>rep()<\/li>\n<li>seq()<\/li>\n<\/ul>\n<p><a href=\"http:\/\/data-flair.training\/blogs\/r-vector-functions\/\">Learn more about R vector Functions in detail.<\/a><br \/>\n<strong>Q.54. Explain how to repeat vectors in R?<\/strong><br \/>\nWe can use the rep() function in several ways if we want to repeat the complete vector. For examples: specify the argument times 1. To repeat the vector c(0, 0, 7) three times, use this code:<br \/>\n[php]&gt; rep(c(0, 0, 7), times = 4)<br \/>\n[1] 0 0 7 0 0 7 0 0 7 0 0 7 2[\/php]<br \/>\nWe can also repeat every value by specifying the argument each, like this:<br \/>\n[php]&gt; rep(c(2, 4, 2), each = 2)<br \/>\n[1] 2 2 4 4 2 2 3[\/php]<br \/>\nWe can tell R for each value how often it has to repeat:<br \/>\n[php]&gt; rep(c(0, 7), times = c(4,3))<br \/>\n[1] 0 0 0 0 7 7 7 4[\/php]<br \/>\nIn seq, we use the argument length.out to define R. it will repeat the vector until it reaches that length, even if the last repetition is incomplete.<br \/>\n[php]&gt; rep(1:3,length.out=9)<br \/>\n[1] 1 2 3 1 2 3 1 2 3[\/php]<br \/>\n<strong>Q.55. How to create vectors in R?<\/strong><br \/>\n<strong>a)<\/strong> To create a vector using integers:<br \/>\nFor Example, We use the colon operator (:) in R.<br \/>\nThe code 2:6 gives you a vector with the numbers 2 to 6, and 3:-4 create a vector with the numbers 3 to \u20134, both in steps of 1.<br \/>\n<strong>b)<\/strong> We use the seq() to make steps in a sequence.<br \/>\nSeq() function used to describe by which the numbers should decrease or increase.<br \/>\nFor Example In R, the vector with a numbers 4.5 to 3.0 in steps of 0.5.<br \/>\n[php]&gt; seq(from = 4.5, to = 3.0, by = -0.5)<br \/>\n[1] 4.5 4.0 3.5 3.0 c[\/php]<br \/>\nYou can specify the length of the sequence by using the argument out. R calculates the step size itself. For Example We can make a vector of nine values going from \u20132.7 to 1.3 like this:<br \/>\n[php]&gt; seq(from = -2.7, to = 1.3, length.out = 9)<br \/>\n[1] -2.7 -2.2 -1.7 -1.2 -0.7 -0.2 0.3 0.8 1.3[\/php]<br \/>\n<strong>Q.56. What is using all() and any()?<\/strong><br \/>\n<strong>a) na.rm \u2013<\/strong> State whether NA values should ignore.<br \/>\n<strong>b) any(\u2026, na.rm=FALSE) \u2026 \u2013<\/strong> One or more R objects that need to be check. na.rm \u2013 State whether NA values should ignore. The any() and all() functions are shortcuts because they report any or all their arguments are TRUE.<br \/>\n[php]&gt; x &lt;- 1:10 &gt; any(x &gt; 5)<br \/>\n[1] TRUE<br \/>\n&gt; any(x &gt; 88)<br \/>\n[1] FALSE<br \/>\n&gt; all(x &gt; 88)<br \/>\n[1] FALSE<br \/>\n&gt; all(x &gt; 0)<br \/>\n[1] TRUE For Example: Suppose that R executes the following:<br \/>\n&gt; any(x &gt; 5)[\/php]<br \/>\nIt first evaluates x &gt; 5:<br \/>\n[php](FALSE, FALSE, FALSE, FALSE, FALSE)[\/php]<br \/>\nWe use any() function &#8211; that reports whether any of those values are TRUE while all() function works and<br \/>\nreports if all the values are TRUE.<br \/>\n<strong>Q.57. What is R&#8217;s C interface?<\/strong><br \/>\nR&#8217;s source code is a powerful technique for Improving Programming skills. But, many base R function was already written in C. It is been used to figure out how those functions work. All functions in R defined with the prefix Rf_ or R_.<br \/>\nOutline of Rs C interface<\/p>\n<ul>\n<li>Input Validations talks about itself so that C function doesn\u2019t crash R.<\/li>\n<li>C data Structures shows how to translate data structure names from R to C.<\/li>\n<li>Creating and modifying vectors teaches how to create, change, and make vectors in C.<\/li>\n<li>Calling C defines the basics of creating. It also defines the functions with the inline package.<\/li>\n<\/ul>\n<p><strong>Q.58. What are Prerequisites for R&#8217;s C interface?<\/strong><br \/>\nWe need a C compiler for C interface. Windows users can use Rtools. Mac users will need the Xcode command line tools. Most Linux distributions will come with the necessary compilers. In Windows, it is necessary to include Windows PATH environment variable in it:<\/p>\n<ul>\n<li>Rtools executables directory (C:\\Rtools\\bin),<\/li>\n<li>C compiler executables directory (C:\\Rtools\\gcc-4.6.3\\bin).<\/li>\n<\/ul>\n<p><strong>Q.59. How to call C function from R?<\/strong><br \/>\nGenerally, to call a C function it required two pieces:<\/p>\n<ul>\n<li>C function.<\/li>\n<li>R wrapper function that uses.Call().<\/li>\n<\/ul>\n<p>The function below adds two numbers together:<br \/>\n[php]\/\/ In C &#8212; &#8212; &#8212; &#8212; &#8212; &#8212; &#8212; &#8212; &#8212; &#8212; &#8212; &#8212; &#8212; &#8212; &#8212; &#8212; &#8212; &#8212; &#8212; &#8212;<br \/>\n#include &lt;R.h&gt;<br \/>\n#include &lt;Rinternals.h&gt;<br \/>\nSEXP add(SEXP a, SEXP b) {<br \/>\nSEXP result = PROTECT(allocVector(REALSXP, 1));<br \/>\nREAL(result)[0] = asReal(a) + asReal(b);<br \/>\nUNPROTECT(1);<br \/>\nreturn result;<br \/>\n}<br \/>\n# In R &#8212; &#8212; &#8212; &#8212; &#8212; &#8212; &#8212; &#8212; &#8212; &#8212; &#8212; &#8212; &#8212; &#8212; &#8212; &#8212; &#8212; &#8212; &#8212; &#8212;<br \/>\nadd &lt;- function(a, b) {<br \/>\n.Call(&#8220;add&#8221;, a, b}<br \/>\n}[\/php]<br \/>\n<strong>Q.60. What are R matrices and R matrices functions?<\/strong><br \/>\nA matrix is a two-dimensional rectangular data set. Thus it can create using vector input to the matrix function. Also, a matrix is a collection of numbers arranged into a fixed number of rows and columns. Usually, the numbers are the real numbers. We reproduce a memory representation of the matrix in R with the matrix function. Hence, the data elements must be of the same basic type. Matrices functions are those functions which we use in matrices.<br \/>\nThere are two types of matrices functions:<\/p>\n<ul>\n<li>apply()<\/li>\n<li>sapply()<\/li>\n<\/ul>\n<p><a href=\"http:\/\/data-flair.training\/blogs\/r-matrices-operations-applications\/\">Learn more about R matrices and Matrices Functions in detail.<\/a><br \/>\n<strong>Q.61. What is apply() function in R?<\/strong><br \/>\nReturn a vector or array or list of values obtained by applying a function to margins of an array or matrix.<br \/>\n<strong>Keywords<\/strong><br \/>\narray, iteration<br \/>\n<strong>Usage<\/strong><br \/>\n[php]apply(X, MARGIN, FUN, \u2026)[\/php]<br \/>\n<strong>Arguments<\/strong><\/p>\n<ul>\n<li>X &#8211; an array, including a matrix<\/li>\n<li>\u2026 &#8211; optional arguments to FUN<\/li>\n<li>FUN &#8211; The function to apply: see \u2018Details\u2019<\/li>\n<li>MARGIN -Functions will apply on subscripts in a vector.<\/li>\n<\/ul>\n<p><strong>Q.62. What is the apply() family in R?<\/strong><br \/>\nApply functions are a family of functions in base R. which allow us to perform an action on many chunks of data. An apply function is a loop, but run faster than loops and often must less code. There are many different\u00a0apply\u00a0functions. The called function could be:<\/p>\n<ul>\n<li>There is some aggregating function. They include meaning, or the sum(includes return a number or scalar);<\/li>\n<li>Other transforming or subsetting functions.<\/li>\n<li>There are some vectorized functions. They return more complex structures like lists, vectors, matrices, and arrays.<\/li>\n<li>We can perform operations with very few lines of code in apply().<\/li>\n<\/ul>\n<p><strong>Q.63. What is sapply() in R?<\/strong><br \/>\nA Dimension Preserving Variant of &#8220;sapply&#8221; and &#8220;lapply&#8221;<br \/>\nsapply\u00a0is a\u00a0user-friendly\u00a0version. It is a wrapper of\u00a0lapply. By default\u00a0sapply\u00a0returning a vector, matrix or an array.<br \/>\n<strong>Keywords<\/strong><br \/>\nMisc, utilities<br \/>\n<strong>Usage<\/strong><br \/>\n[php]Sapply(X, FUN, &#8230;, simplify = TRUE, USE.NAMES = TRUE)<br \/>\nLapply(X, FUN, &#8230;)[\/php]<br \/>\n<strong>Arguments<\/strong><\/p>\n<ul>\n<li>X &#8211; It is a vector or list to call\u00a0sapply.<\/li>\n<li>FUN &#8211; a function.<\/li>\n<li>&#8230; &#8211; optional arguments to FUN.<\/li>\n<li>simplify &#8211; It is a logical value which defines whether a result is been simplified to a vector or<\/li>\n<li>matrix if possible?<\/li>\n<li>USE.NAMES &#8211; logical; if TRUE and if X is a character, use X as names for the result unless it had names already.<\/li>\n<\/ul>\n<p><strong>Q.64. How to use sapply in R?<\/strong><br \/>\nMultipy all values by 10:<br \/>\n[php]&gt; sapply(BOD,function(x) 10 * x)<br \/>\nTime demand<br \/>\n[1,] 10 80<br \/>\n[2,] 20 100<br \/>\n[3,] 30 190[\/php]<br \/>\nUsed for array, margin set to 1:<br \/>\n[php]&gt; x &lt;- array(1:9) &gt; sapply(x,function(x) x * 10)<br \/>\n[1] 10 20 30 40 50 60 70 80 90[\/php]<br \/>\nTwo dimension array, margin can be 1 or 2:<br \/>\n[php]&gt; x &lt;- array(1:9,c(3,3)) &gt; x<br \/>\n[,1]\u00a0 \u00a0[,2]\u00a0 \u00a0[,3]<br \/>\n[1,]\u00a0 \u00a0 \u00a0 1\u00a0 \u00a0 \u00a0 4\u00a0 \u00a0 \u00a0 7<br \/>\n[2,]\u00a0 \u00a0 \u00a0 2\u00a0 \u00a0 \u00a0 5\u00a0 \u00a0 \u00a0 8<br \/>\n[3,]\u00a0 \u00a0 \u00a0 3\u00a0 \u00a0 \u00a0 6\u00a0 \u00a0 \u00a0 9<br \/>\n&gt; sapply(x,function(x) x * 10)<br \/>\n[1] 10 20 30 40 50 60 70 80 90[\/php]<br \/>\nsapply: returns a vector, matrix or an array<br \/>\n#\u00a0sapply\u00a0: returns a vector, an array or matrix<br \/>\n[php]sapply(c(1:3), function(x) x^2)<br \/>\n[1] 1 4 9[\/php]<br \/>\n<strong>Q.65. What is R matrices?<\/strong><br \/>\nA matrix is a two-dimensional rectangular data set and thus it can be created using vector input to the matrix function. In addition, a matrix is a collection of numbers arranged into a fixed number of rows and columns. Usually, the numbers are the real numbers. By using a matrix function we can reproduce a memory representation of the matrix in R. Hence, the data elements must be of the same basic type.<br \/>\n<a href=\"http:\/\/data-flair.training\/blogs\/r-matrices-operations-applications\/\">learn R matrices in detail.<\/a><br \/>\n<strong>Q.66. How many methods are available to use the matrices?<\/strong><br \/>\nThere are so many methods to solve the matrices like adding, subtraction, negative etc.<br \/>\n<a href=\"http:\/\/data-flair.training\/blogs\/r-matrix-functions\/\">Learn R Matrices Functions in detail.<\/a><br \/>\n<strong>Q.67. What is control structure in R?<\/strong><br \/>\nR has the standard control structures we would expect. <strong>expr<\/strong> can be multiple statements by enclosing them in braces { }. It is more efficient to use built-in functions rather than control structures whenever possible. These allow us to control the flow of execution of a script typically inside of a function. Control structures define the flow of the program. The decision is been based on the evaluation of a variable.<br \/>\n<a href=\"http:\/\/data-flair.training\/blogs\/control-structures-in-r-programming\/\">Learn R Control Structures in detail.<\/a><br \/>\n<strong>Q.68. How many control statements are present in R?<\/strong><br \/>\nThere are eight control statements are present in R.<br \/>\n<strong>Q.69. Name all control statements present in R?<\/strong><\/p>\n<ul>\n<li>If<\/li>\n<li>If-else<\/li>\n<li>For<\/li>\n<li>Nested loops<\/li>\n<li>While<\/li>\n<li>Repeat and break<\/li>\n<li>Next<\/li>\n<li>return<\/li>\n<\/ul>\n<div id=\"attachment_4765\" style=\"width: 330px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/Control-Statements-Present-in-R-1.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-4765\" class=\"wp-image-4765 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/Control-Statements-Present-in-R-1.jpg\" alt=\"R Control Statements - r programming interview questions\" width=\"320\" height=\"314\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/Control-Statements-Present-in-R-1.jpg 320w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/Control-Statements-Present-in-R-1-150x147.jpg 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/Control-Statements-Present-in-R-1-300x294.jpg 300w\" sizes=\"auto, (max-width: 320px) 100vw, 320px\" \/><\/a><p id=\"caption-attachment-4765\" class=\"wp-caption-text\">R Control Statements &#8211; r programming interview questions<\/p><\/div>\n<p><strong>Q.70. What is Recursion in R?<\/strong><br \/>\n[php]calculate_sum() &lt;- function(n) {<br \/>\nif(n &lt;= 1) { return(n) } else { return(n + calculate_sum(n-1)) } } Output: &gt; calculate_sum(4)<br \/>\n[1] 10[\/php]<br \/>\nHere, calculate_sum(n-1) is been used to compute the addition up to that number.Let suppose the user passes 4 to<\/p>\n<h2>Advanced R Interview Questions<\/h2>\n<p><strong>Q.71. What is Recursive Function in R?<\/strong><br \/>\nRecursive functions call themselves. They break down the problem into the smallest possible components.\u00a0The function() calls itself within the original function() on each of the smaller components. After this, the results will put together to solve the original problem.<br \/>\nFor Example:<br \/>\n[php] Factorial &lt;- function(N)<br \/>\n{<br \/>\nif (N == 0)<br \/>\nreturn(1)<br \/>\nelse<br \/>\nreturn( N * Factorial (N-1))<br \/>\n}[\/php]<br \/>\n<a href=\"http:\/\/data-flair.training\/blogs\/r-recursive-function\/\">Learn more about R Recursive Functions in detail.<\/a><br \/>\n<strong>Q.72. What are applications of Recursion?<\/strong><br \/>\n<strong>a) Dynamic Programming\u00a0<\/strong><br \/>\nIt is the process of avoiding recomputation. It is an essential tool for statistical programming. There are two types of dynamic programming:<br \/>\n<strong>i) Bottom-up dynamic programming\u00a0<\/strong><\/p>\n<ul>\n<li>In this, we check function starting with smallest possible argument value.<\/li>\n<li>All computed values will be stored in an array.<\/li>\n<\/ul>\n<p><strong>ii)<\/strong> <strong>Top-down dynamic programming<\/strong><\/p>\n<ul>\n<li>Save each computed value as the final act of a recursive function.<\/li>\n<li>Check if pre-computed values exist as the first action.<\/li>\n<\/ul>\n<p><strong>b) Divide-And-Conquer Algorithms<\/strong><\/p>\n<ul>\n<li>It is a Common class of recursive function.<\/li>\n<li>Common features of this algorithm are process inputs, divide the input into<\/li>\n<li>Smaller portions, Recursive call(s) process at least one part.<\/li>\n<li>Recursion may sometimes occur before the input is been processed.<\/li>\n<\/ul>\n<p><strong>Q.73. What are Features of Recursion?<\/strong><\/p>\n<ul>\n<li>The use of recursion, often, makes code shorter and looks clean.<\/li>\n<li>It is a Simple solution for a few cases.<\/li>\n<li>It expresses in a function that calls itself.<\/li>\n<\/ul>\n<div id=\"attachment_4766\" style=\"width: 330px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/Features-of-Recursion.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-4766\" class=\"wp-image-4766 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/Features-of-Recursion.jpg\" alt=\"R interview questions - Features of Recursion\" width=\"320\" height=\"314\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/Features-of-Recursion.jpg 320w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/Features-of-Recursion-150x147.jpg 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/Features-of-Recursion-300x294.jpg 300w\" sizes=\"auto, (max-width: 320px) 100vw, 320px\" \/><\/a><p id=\"caption-attachment-4766\" class=\"wp-caption-text\">R interview questions &#8211; Features of Recursion<\/p><\/div>\n<p><strong>Q.74. What is OOP in R?<\/strong><br \/>\nObject-oriented programming is a popular programming language. It allows us to construct modular pieces of code which are used as building blocks for large systems. R is a functional language. It also supports exists for programming in an object-oriented style. OOP is a superb tool to manage complexity in larger programs. It is particularly suited to GUI development. R has two different OOP systems, known as S3 and S4.<br \/>\n<a href=\"http:\/\/data-flair.training\/blogs\/object-oriented-programming-in-r\/\">Learn more about R Object Oriented programming in detail.<\/a><br \/>\n<strong>Q.75. What is S3 in R?<\/strong><br \/>\nThe S3 class is used to overload any function. It means calling a different name of the function. It depends upon the type of input parameter or the number of a parameter).<br \/>\n<strong>Q.76. What is S4?<\/strong><br \/>\nThe\u00a0S4 class is a characteristic OOP system, but it is tricky to debug.<br \/>\n<strong>Q.77. What is reference class?<\/strong><br \/>\nReference classes are the modern alternative for S4 classes.<br \/>\n<strong>Q.78. How to create the S3 class?<\/strong><br \/>\nWe can show how to define a function that will create and return an object of a given class. A list is been created with the relevant members, the list\u2019s class is set, and a copy of the list is been\u00a0returned.<br \/>\n<strong>Q.79. How to construct a new S3 class?<\/strong><br \/>\nFor Example:<br \/>\n[php]&gt; jim &lt;- list(height = 2.54 * 12 * 6\/100, weight = 180\/2.2,+ name = &#8220;James&#8221;) &gt; class(jim) &lt;- &#8220;person&#8221; &gt; class(jim)[\/php]<br \/>\nWe have now made an object of class person<br \/>\nWe now define a print method.<br \/>\n[php]&gt; print(jim)<br \/>\n&gt; print.person &lt;- function(x, &#8230;) { + cat(&#8220;name:&#8221;, x$name, &#8220;\\n&#8221;) + cat(&#8220;height:&#8221;, x$height, &#8220;meters&#8221;, &#8220;\\n&#8221;) + cat(&#8220;weight:&#8221;, x$weight, &#8220;kilograms&#8221;, &#8220;\\n&#8221;) + } &gt; print(jim)[\/php]<br \/>\nNote the method\/class has the \u201ddot\u201d naming convention of method.class.<br \/>\n<strong>Q.80. What is inheritance in S3 class?<\/strong><br \/>\nIn S3, inheritance is achieved by the class attribute being a vector.<br \/>\nFor Example:<br \/>\n[php]&gt; fit &lt;- glm(rpois(100, lambda = 1) ~ + 1, family = &#8220;poisson&#8221; &gt; class(fit)<br \/>\n&gt; methods(&#8220;residuals&#8221;)<br \/>\n&gt; methods(&#8220;model.matrix&#8221;)[\/php]<br \/>\nIf no method for the first is found, the second class is checked.<br \/>\n<strong>Q.81. What are useful S3 method functions?<\/strong><\/p>\n<ul>\n<li>methods(&#8220;print&#8221;) and methods(class = &#8220;lm&#8221;)<\/li>\n<li>getS3method(&#8220;print&#8221;,&#8221;person&#8221;) : Gets the appropriate method associated with a class, useful to see how a method is implemented.<\/li>\n<li>Sometimes, methods are non-visible, because they are hidden in a namespace. Use getS3method or getAnywhere to get around this-<\/li>\n<\/ul>\n<p>[php]&gt; residuals.HoltWinters<br \/>\n&gt; getS3method(&#8220;residuals.HoltWinters&#8221;)<br \/>\n&gt; getAnywhere(&#8220;residuals.HoltWinters&#8221;)[\/php]<br \/>\n<strong>Q.82. How to construct new S4 class?<\/strong><br \/>\n[php]velocity = c(0.0,0.0)<br \/>\n),<br \/>\n# Make a function that can test to see if the data is consistent.<br \/>\n# This is not called if you have an initialize function defined!<br \/>\nvalidity=function(object)<br \/>\n{<br \/>\nif(sum(object@velocity^2)&gt;100.0) {<br \/>\nreturn(&#8220;The velocity level is out of bounds.&#8221;)<br \/>\n}<br \/>\nreturn(TRUE)<br \/>\n}<br \/>\n)[\/php]<br \/>\nNow that the code to define the class is given we can create an object whose class is Agent.<br \/>\n[php]&gt; a &lt;- Agent() &gt; a<br \/>\nAn object of class &#8220;Agent&#8221;<br \/>\nSlot &#8220;location&#8221;:<br \/>\n[1] 0 0<br \/>\nSlot &#8220;velocity&#8221;:<br \/>\n[1] 0 0<br \/>\nSlot &#8220;active&#8221;:<br \/>\n[1] TRUE[\/php]<br \/>\n<strong>Q.83. What is S4 Generic?<\/strong><br \/>\nThe function setGeneric is the call to make a new generic function.<br \/>\n[php]&gt; setGeneric(&#8220;BMI&#8221;, function(object) standardGeneric(&#8220;BMI&#8221;))<br \/>\n&gt; setMethod(&#8220;BMI&#8221;, &#8220;personS4&#8221;, function(object) {<br \/>\n+ object@weight\/object@height^2<br \/>\n+ })<br \/>\n&gt; BMI(jimS4)[\/php]<br \/>\n<strong>Q.84. How to request an input from the user through keyboard and monitor?<\/strong><br \/>\nIn R, there are a series of functions that can\u00a0be used\u00a0to request an input from the user,<br \/>\nincluding\u00a0readline(), cat(), and scan(). But, I find the\u00a0readline() function to be the optimal function for this task.<br \/>\n<a href=\"http:\/\/data-flair.training\/blogs\/input-output-features-in-r\/\">Learn more about Input Output functions in R.<\/a><br \/>\n<strong>Q.85. How to read data from the keyboard?<\/strong><br \/>\nTo read the data from keyboard we use three different functions:<\/p>\n<ul>\n<li>scan()<\/li>\n<li>readline()<\/li>\n<li>print()<\/li>\n<\/ul>\n<p><strong>Q.86. How many ways are there to read and write files?<\/strong><br \/>\nThere are three ways to read and write files respectively:<\/p>\n<ul>\n<li>Reading a data or matrix from a file<\/li>\n<li>Reading a single File One Line at a Time<\/li>\n<li>Writing a Table to a File<\/li>\n<\/ul>\n<div id=\"attachment_4769\" style=\"width: 330px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/Ways-to-read-and-write-files-in-R.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-4769\" class=\"wp-image-4769 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/Ways-to-read-and-write-files-in-R.jpg\" alt=\"r interview questions - read and write files in R\" width=\"320\" height=\"314\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/Ways-to-read-and-write-files-in-R.jpg 320w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/Ways-to-read-and-write-files-in-R-150x147.jpg 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/Ways-to-read-and-write-files-in-R-300x294.jpg 300w\" sizes=\"auto, (max-width: 320px) 100vw, 320px\" \/><\/a><p id=\"caption-attachment-4769\" class=\"wp-caption-text\">r interview questions &#8211; read and write files in R<\/p><\/div>\n<p><strong>Q.87. Explain how to read data or a matrix from a file?<\/strong><br \/>\n<strong>a)<\/strong> Usually we use function read.table() to read data. The default value of a header is \u2018FALSE\u2019 and hence when we do not have a header, we need not say such. , R factors are also called as character strings. For turning this \u201cfeature\u201d off, you can include the argument as.is=T in your call to read.table().<br \/>\n<strong>b)<\/strong> When you have a spreadsheet export file, i.e. having a type.csv where the fields\u00a0are divided by\u00a0commas in place of spaces, use read.csv() in place of read.table(). To read spreadsheet files we can use read.xls.<br \/>\n<strong>c)<\/strong> When you read in a matrix using read.table(), the resultant object will become a data frame, even when all the entries got to be numeric. A case exists which may followup call towards as.matrix() in a matrix. We need to read it into a matrix form like this<br \/>\n&gt; x &lt;- matrix(scan(&#8220;x&#8221;),nrow=5,byrow=T)<br \/>\n<strong>Q.88. What are connections In R?<\/strong><br \/>\nFunctions to Manipulate Connections (Files, URLs, &#8230;). Functions to create, open and close connections.<br \/>\nFor example: \u201cgeneralized files\u201d, such as compressed files, URLs, pipes, etc.<br \/>\n<strong>Keywords<\/strong><br \/>\nfile, connection<br \/>\n<a href=\"http:\/\/data-flair.training\/blogs\/input-output-features-in-r\/\">Learn more about the connections in R.<\/a><br \/>\n<strong>Q.89. Explain an Extended example of connections?<\/strong><br \/>\n<strong>Extended Example:<\/strong> Reading PUMS sample files<br \/>\nThese files contain records for a sample of housing units with information on the characteristics of each unit.<\/p>\n<ul>\n<li><strong>\u00a0Why use PUMS?<\/strong><\/li>\n<\/ul>\n<p>PUMS files provide greater accessibility to inexpensive data for research projects.\u00a0Thus it is beneficial for students as they are looking for greater accessibility to inexpensive data. Social scientists often use the PUMS for regression analysis and modeling applications.<\/p>\n<ul>\n<li><strong>How can I access PUMS?<\/strong><\/li>\n<\/ul>\n<p>Statistical software is the tool used to work with PUMS files.<br \/>\n<strong>Q.90. Which function is used to write files?<\/strong><br \/>\nWe use write.csv() to write files.<br \/>\n<strong>Q.91. Explain how to write files?<\/strong><br \/>\nWe use write.csv() to write file. By default, write.csv() includes row names.<br \/>\n[php]# A sample data frame<br \/>\ndata &lt;- read.table(header=TRUE, text=&#8217;<br \/>\nsubject sex size<br \/>\n1 M 7<br \/>\n2 F NA<br \/>\n3 F 9<br \/>\n4 M 11<br \/>\n&#8216;)<br \/>\n# Write to a file, suppress row names<br \/>\nwrite.csv(data, &#8220;data.csv&#8221;, row.names=FALSE)<br \/>\n# Same, except that instead of &#8220;NA&#8221;, output blank cells<br \/>\nwrite.csv(data, &#8220;data.csv&#8221;, row.names=FALSE, na=&#8221; &#8220;)<br \/>\n# Use tabs, suppress row names and column names<br \/>\nwrite.table(data, &#8220;data.csv&#8221;, sep=&#8221;\\t&#8221;, row.names=FALSE, col.names=FALSE)[\/php]<br \/>\n<strong>Q.92. What is TCP\/IP in R?<\/strong><br \/>\nTCP\/IP is a set of protocols. It is a primary tech of the internet. When we browse the web, send email, chat online, online gaming, TCP\/IP is working underneath.<br \/>\n<a href=\"http:\/\/data-flair.training\/blogs\/input-output-features-in-r\/\">Learn more about TCP\/IP in R.<\/a><br \/>\n<strong>Q.93. What is TCP\/IP variable SMC-R storage allocations?<\/strong><\/p>\n<ul>\n<li>Each more RMB that is been allocated for a particular SMC-R link group can accommodate 4 \u2013 32<br \/>\nmore TCP connections, depending on the RCVBFRSIZE value of the TCP connections.<\/li>\n<li>More staging buffers\u00a0are allocated\u00a0as the volume of application data that is been sent increases.<\/li>\n<li>RMBs, staging buffers, and RDMA receive and send elements are all eligible to\u00a0be deallocated\u00a0if the\u00a0volume of application traffic decreases.<\/li>\n<\/ul>\n<p><strong>Q.94. What are Sockets in R?<\/strong><br \/>\nSockets provide two networked machines with a bidirectional communication channel.\u00a0Servers\u00a0are accessed\u00a0via socket addresses, a combination of the server&#8217;s IP address and a port number.\u00a0We use the port as a connection point on the server, like USB or Firewire ports, with each port serving a specific purpose.<br \/>\n<strong>For example:<\/strong><br \/>\nWeb pages\u00a0are served\u00a0on port 80 (HTTP), emails\u00a0are sent\u00a0via port 25 (SMTP).<br \/>\n<strong>Usage<\/strong><br \/>\n[php]make.socket(host = &#8220;localhost&#8221;, port, fail = TRUE, server = FALSE)[\/php]<br \/>\n<strong>Arguments<\/strong><br \/>\nhost name of remote host<br \/>\nport port to connect to\/listen on<br \/>\nfail failure to connect is an error?<br \/>\nServer a server socket?<br \/>\n<a href=\"http:\/\/data-flair.training\/blogs\/input-output-features-in-r\/\">Learn more about Sockets in detail.<\/a><br \/>\n<strong>Q.95. What is protocol?<\/strong><br \/>\nA protocol is a set of rules and procedures. It means what format to use, what data mean, when should data be sent. When two computers exchange data, they can understand each other if both follow specific format and rules in a protocol. It is a set of rules and procedures and computers. It is been used to communicate.<br \/>\n<a href=\"http:\/\/data-flair.training\/blogs\/input-output-features-in-r\/\">Learn more about Protocols in detail.<\/a><br \/>\n<strong>Q.96. What does TCP\/IP work?<\/strong><br \/>\nTCP\/IP protocols map to a four-layer conceptual model known as the DARPA model. The four layers of the DARPA model are Application, Transport, Internet, and Network Interface.<br \/>\n<strong>Q.97. Explain TCP\/IP applications, services and protocols?<\/strong><\/p>\n<ul>\n<li><strong>Bootstrap protocol &#8211;\u00a0<\/strong>Bootstrap Protocol (BOOTP) provides a dynamic method for associating workstations with servers.\u00a0It is a method which also provides a dynamic method for assigning workstation Internet Protocol (IP) addresses and initial program load (IPL) sources.<\/li>\n<li><strong>Domain name system &#8211;<\/strong> We use Domain Name System (DNS) to manage host names and their associated Internet Protocol (IP).<\/li>\n<li><strong>Email &#8211;<\/strong> Use this information to plan for, configure, use, manage, and troubleshoot e-mail on your system.<\/li>\n<li><strong>Open shortest path first search &#8211;<\/strong> IBM I support includes the Open Shortest Path First (OSPF) protocol. OSPF is a link-state, hierarchical Interior Gateway Protocol (IGP) for network routing.<\/li>\n<li><strong>RouteD &#8211;<\/strong> The Route Daemon (RouteD) provides support for the Routing Information Protocol (RIP) on the IBM\u00a0platform.<\/li>\n<li><strong>Simple network time protocol &#8211;<\/strong> It is a time-maintenance application that we can use to synchronize hardware in a network.<\/li>\n<\/ul>\n<div id=\"attachment_4767\" style=\"width: 330px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/TCP-IP-applicationsservices-and-protocols.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-4767\" class=\"wp-image-4767 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/TCP-IP-applicationsservices-and-protocols.jpg\" alt=\"R interview questions and answers - TCP\/IP\" width=\"320\" height=\"314\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/TCP-IP-applicationsservices-and-protocols.jpg 320w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/TCP-IP-applicationsservices-and-protocols-150x147.jpg 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/TCP-IP-applicationsservices-and-protocols-300x294.jpg 300w\" sizes=\"auto, (max-width: 320px) 100vw, 320px\" \/><\/a><p id=\"caption-attachment-4767\" class=\"wp-caption-text\">R interview questions and answers &#8211; TCP\/IP<\/p><\/div>\n<p><strong>Q.98. What is TCP\/IP variable SMC-R storage allocations?<\/strong><\/p>\n<ul>\n<li>Each more RMB that is been allocated for a particular SMC-R link group can accommodate 4 \u2013 32<br \/>\nmore TCP connections, depending on the RCVBFRSIZE value of the TCP connections.<\/li>\n<li>More staging buffers\u00a0are allocated\u00a0as the volume of application data that is been sent increases.<\/li>\n<li>RMBs, staging buffers, and RDMA receive and send elements are all eligible to\u00a0be deallocated\u00a0if the volume of application traffic decreases.<\/li>\n<\/ul>\n<p><strong>Q.99. What is debugging in R?<\/strong><br \/>\nA grammatically correct program may give us incorrect results due to logic errors. In case such errors (i.e. bugs) occur, we need to find out why and where they occur so that you can fix them. The procedure to identify and fix bugs is called \u201cdebugging\u201d.<br \/>\n<a href=\"http:\/\/data-flair.training\/blogs\/debugging-in-r-programming\/\">Learn about R Debugging in detail.<\/a><\/p>\n<h2>3. Top R Programming Interview Questions<\/h2>\n<p><strong>Q.100. What are tools for debugging in R?<\/strong><br \/>\nThere are five toos present for debugging in R respectively:<\/p>\n<ul>\n<li>traceback()<\/li>\n<li>debug()<\/li>\n<li>browser()<\/li>\n<li>trace()\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 <strong>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 <\/strong><\/li>\n<li>recover()<\/li>\n<\/ul>\n<div id=\"attachment_4768\" style=\"width: 330px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/Tools-for-debugging.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-4768\" class=\"wp-image-4768 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/Tools-for-debugging.jpg\" alt=\"R interview questions and answers - Tools for Debugging in R\" width=\"320\" height=\"314\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/Tools-for-debugging.jpg 320w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/Tools-for-debugging-150x147.jpg 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/Tools-for-debugging-300x294.jpg 300w\" sizes=\"auto, (max-width: 320px) 100vw, 320px\" \/><\/a><p id=\"caption-attachment-4768\" class=\"wp-caption-text\">R interview questions and answers &#8211; Tools for Debugging in R<\/p><\/div>\n<p><strong>Q.101. What are fundamental principles of debugging?<\/strong><br \/>\nProgrammers often find that they spend more time debugging a program than actually writing it. Good debugging skills are invaluable. There are four basic principles of debugging:<\/p>\n<ul>\n<li>The essence of debugging: The principle of confirmation<\/li>\n<li>Start Small<\/li>\n<li>Debug in a Modular, Top-Down Manner<\/li>\n<li>Antibugging<\/li>\n<\/ul>\n<div id=\"attachment_4803\" style=\"width: 208px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/Principles-of-Debugging.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-4803\" class=\"wp-image-4803 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/Principles-of-Debugging.jpg\" alt=\"R interview questions - Principles of Debugging\" width=\"198\" height=\"320\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/Principles-of-Debugging.jpg 198w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/Principles-of-Debugging-93x150.jpg 93w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/Principles-of-Debugging-186x300.jpg 186w\" sizes=\"auto, (max-width: 198px) 100vw, 198px\" \/><\/a><p id=\"caption-attachment-4803\" class=\"wp-caption-text\">R interview questions &#8211; Principles of Debugging<\/p><\/div>\n<p><strong>Q.102. What is a Graphic device?<\/strong><br \/>\nA graphics device is something where we can make a plot to appear. When we make a plot in R, it has to be \u201csent\u201d to a specific.<\/p>\n<ul>\n<li>Window on your computer (screen device) 2. PDF file (file device)<\/li>\n<li>PNG or JPEG file (file device)<\/li>\n<li>Scalable vector graphics (SVG) file (file device)<\/li>\n<\/ul>\n<p>The most common place for a plot to be \u201csent\u201d is the screen device.<\/p>\n<ul>\n<li>A Mac, the screen device is launched with the quartz()<\/li>\n<li>Windows, the screen device is launched with windows()<\/li>\n<li>Unix\/Linux, the screen device is launched with x11()<\/li>\n<\/ul>\n<div id=\"attachment_4804\" style=\"width: 330px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/Graphics-Devices.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-4804\" class=\"wp-image-4804 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/Graphics-Devices.jpg\" alt=\"List of Graphics Devices - R interview questions\" width=\"320\" height=\"320\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/Graphics-Devices.jpg 320w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/Graphics-Devices-150x150.jpg 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/Graphics-Devices-300x300.jpg 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/Graphics-Devices-100x100.jpg 100w\" sizes=\"auto, (max-width: 320px) 100vw, 320px\" \/><\/a><p id=\"caption-attachment-4804\" class=\"wp-caption-text\">List of Graphics Devices &#8211; R interview questions<\/p><\/div>\n<p><a href=\"http:\/\/data-flair.training\/blogs\/save-graphs-to-files-in-r\/\">Learn more about R Graphic Devices in detail.<\/a><br \/>\n<strong>Q.103. Explain R graphics devices?<\/strong><br \/>\nThe following devices are currently available:<\/p>\n<ul>\n<li><strong>PDF &#8211;<\/strong> Write PDF graphics commands to file.<\/li>\n<li><strong>xfig &#8211;<\/strong> Device for XFIG graphics file format.<\/li>\n<li><strong>pictex &#8211;<\/strong> Writes TeX\/PicTeX graphics commands to a file (of historical interest only).<\/li>\n<li><strong>postscript &#8211;<\/strong> Writes PostScript graphics commands to a file.<\/li>\n<li><strong>bitmap &#8211;<\/strong> bitmap pseudo-device via Ghostscript (if available).<\/li>\n<\/ul>\n<p>The following devices will be functional if R was compiled to use them:<\/p>\n<ul>\n<li><strong>png \u2013<\/strong> PNG bitmap device<\/li>\n<li><strong>jpeg \u2013<\/strong> JPEG bitmap device<\/li>\n<li><strong>bmp \u2013<\/strong> BMP bitmap device<\/li>\n<li><strong>tiff \u2013<\/strong> TIFF bitmap device<\/li>\n<li><strong>X11 &#8211;<\/strong> The graphics device for the X11 windowing system.<\/li>\n<li><strong>svg &#8211;<\/strong> SVG device based on Cairo graphics.<\/li>\n<li><strong>cario.pdf &#8211;<\/strong> cairo_ps PDF and PostScript devices based on Cairo graphics.<\/li>\n<li><strong>quartz &#8211;<\/strong> The graphics device for the macOS native Quartz 2d graphics system.<\/li>\n<\/ul>\n<p><strong>Q.104. Explain how to save graphs in R?<\/strong><br \/>\nR runs on so many different operating systems. It supports so many different graphics formats.<\/p>\n<ul>\n<li><strong>JPEG &#8211;\u00a0<\/strong>jpeg is been used anywhere but doesn\u2019t resize<\/li>\n<li><strong>PNG<\/strong> &#8211; png is been used anywhere but doesn\u2019t resize<\/li>\n<li><strong>WMF<\/strong>\u00a0&#8211; win.metafile Windows only; best choice with Word; easily resizable<\/li>\n<li><strong>PDF<\/strong>\u00a0&#8211; pdf pdflatex; easily resizable<\/li>\n<li><strong>Postscript<\/strong>\u00a0&#8211; Postscript latex and Open Office; easily resizable<\/li>\n<\/ul>\n<p><strong>Q.105. How many methods are there to save graphs?<\/strong><br \/>\nThere are three methods to save graphs respectively:<\/p>\n<ul>\n<li>A General method<\/li>\n<li>another approach<\/li>\n<li>Local Sessions with Windows or OS X<\/li>\n<\/ul>\n<div id=\"attachment_4805\" style=\"width: 330px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/Methods-to-save-graphs.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-4805\" class=\"wp-image-4805 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/Methods-to-save-graphs.jpg\" alt=\"r questions and answers - Methods to Save Graphs in R\" width=\"320\" height=\"320\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/Methods-to-save-graphs.jpg 320w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/Methods-to-save-graphs-150x150.jpg 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/Methods-to-save-graphs-300x300.jpg 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/Methods-to-save-graphs-100x100.jpg 100w\" sizes=\"auto, (max-width: 320px) 100vw, 320px\" \/><\/a><p id=\"caption-attachment-4805\" class=\"wp-caption-text\">r questions and answers &#8211; Methods to Save Graphs in R<\/p><\/div>\n<p><a href=\"http:\/\/data-flair.training\/blogs\/save-graphs-to-files-in-r\/\">Learn more about How to Save Graphs in R.<\/a><br \/>\n<strong>Q.106. What does the term&#8221;Dreaded for loop&#8221; means?<\/strong><br \/>\nIn R, many questions arise how to accomplish various tasks without for loops. There seems to be a feeling that programmers should avoid these loops at all costs.Those who pose the queries usually have the goal of speeding up their code.<br \/>\n<strong>Q.107. Give an example of &#8220;Dreaded for loop&#8221;?<\/strong><br \/>\nEx- Vectorization for speedup<br \/>\nSometimes, we can use vectorization instead of looping. For example, if x and y are vectors of equal lengths, you can write this:<br \/>\nz &lt;- x + y<br \/>\nThis is not only more compact, but even more important, it is faster than using this loop and if we understand the nuts and bolts of vectorization in R, it may help us to write shorter, simpler, safer, and yes, a faster code in the first place.<br \/>\n<strong>Q.108. What Is functional programming and memory issues in on the performance basis?<\/strong><\/p>\n<ul>\n<li><strong>Functional Programming &#8211;<\/strong> R is a functional programming (FP) language. This means that it provides many tools for the creation and manipulation of functions. In particular, R has what&#8217;s known as first-class functions.<\/li>\n<li><strong>Memory issues &#8211;<\/strong> Most R objects are immutable, or unchangeable. Thus, R operations are implemented as functions that re-assign to the given object, a trait that can have performance implications.<\/li>\n<\/ul>\n<p><strong>Q.109. What do copy-on-change issues in R?<\/strong><br \/>\nWe will discuss an important feature of R that makes it safer to work with data. Suppose we create a simple numeric vector x1:<br \/>\n[php]x1 &lt;- c(1, 2, 3)[\/php]<br \/>\nThen, we assign the value of x1 to x2:<br \/>\n[php]x2 &lt;- x1[\/php]<br \/>\nNow, x1 and x2 have exactly the same value. What if we modify an element in one of the two vectors? Will both vectors change?<br \/>\n[php]x1[1] &lt;- 0<br \/>\nx1<br \/>\n## [1] 0 2 3<br \/>\nx2<br \/>\n## [1] 1 2 3[\/php]<br \/>\nThe output shows that when x1 is changed, x2 will remain unchanged. You may guess that the assignment automatically copies the value and makes the new variable point to the copy of the data instead of the original data.<br \/>\n<strong>Q.110. How Using Rprof() to Find Slow Spots in Your Code in R?<\/strong><br \/>\nIf our R code is running unnecessarily slowly, a handy tool for finding the<br \/>\n<strong>a) Monitoring with Rprof() &#8211;<\/strong> We will call Rprof() to get the monitor started, run our code, and then call Rprof() with a NULL argument to stop the monitoring.<br \/>\n<strong>b) Profiling R code &#8211;<\/strong> Profiling R code gives you the chance to identify bottlenecks and pieces of code that needs to be more efficiently implemented just by changing one line of the code from<br \/>\n[php]x = data.frame(a = variable1, b = variable2)[\/php]<br \/>\nto<br \/>\n[php]x = c(variable1, variable2)[\/php]<br \/>\nThis big reduction happened because this line of code was called several times during the execution of the function.<br \/>\n<strong>c) Using R code profiling functions<\/strong><\/p>\n<ul>\n<li>rprof is a function included in the base package utils, which is loaded by default.<\/li>\n<li>To use R profiling in our code, we can call this function and specify its parameters, including the name of the location of the log file that will be written. See the help for rprof for details.<\/li>\n<li>Profiling can be turned on and off in your code.<\/li>\n<\/ul>\n<p><strong>Q.111. What is vectorization in R?<\/strong><br \/>\nVectorized functions are a very useful feature of R, but programmers who are used to other languages often have trouble with this concept at first. A vectorized function works not just on a single value, but on a whole vector of values at the same time. But if you understand the nuts and bolts of vectorization in R, it may help you write shorter, simpler, safer, and yes, the faster code in the first place.<br \/>\n<strong>Q.112. What is bytecode compilation?<\/strong><br \/>\nBytecode objects consist of an integer vector representing instruction opcodes and operands, and a generic vector representing a constant pool. The compiler is implemented almost entirely in R, with just a few support routines in C to manage compiled code objects is called compiler interface.<br \/>\n<strong>Q.113. What is the byte in R?<\/strong><br \/>\nA byte is a data equal to either seven or eight bits depending if it needs error correction (parity)<br \/>\n<strong>Q.114. What is JIT in R?<\/strong><br \/>\nThere are two R packages available that offers Just-in-time compilation to R users: the {jit} package and the {compiler} package.<br \/>\n<strong>Q.115. What is JIT package?<\/strong><br \/>\nThe {jit} package was created by Stephen Milborrow which provides a just-in-time compilation of R loops and arithmetic expressions in loops, enabling such code to run much faster.<br \/>\n<strong>Q.116. What is Preliminaries in R?<\/strong><\/p>\n<ul>\n<li>R is case sensitive<\/li>\n<li># is the comment tag<\/li>\n<li>R is installed with a default library\/packages. We can add\/ import extra Packages to the library using the command library()<\/li>\n<li>To use a library function you must load it first into memory using the command load()<\/li>\n<li>Basic instructions are memory resident (you do not need to load them)<\/li>\n<li>Variable names cannot start with \u201c.\u201d (dot), \u201c+\u201d (plus sign) or \u201c-\u201d(minus sign)<\/li>\n<\/ul>\n<div id=\"attachment_4802\" style=\"width: 330px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/Preliminaries-in-R.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-4802\" class=\"wp-image-4802 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/Preliminaries-in-R.jpg\" alt=\"R interview questions and answers - Preliminaries in R\" width=\"320\" height=\"320\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/Preliminaries-in-R.jpg 320w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/Preliminaries-in-R-150x150.jpg 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/Preliminaries-in-R-300x300.jpg 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/Preliminaries-in-R-100x100.jpg 100w\" sizes=\"auto, (max-width: 320px) 100vw, 320px\" \/><\/a><p id=\"caption-attachment-4802\" class=\"wp-caption-text\">R interview questions and answers &#8211; Preliminaries in R<\/p><\/div>\n<p><strong>Q.117. How many types of C\/C++ preliminaries are present in R?<\/strong><br \/>\nThere are so many types of C\/C++ preliminaries are present in R. some of them are mentioned below:<\/p>\n<ul>\n<li>Tokens<\/li>\n<li>Keywords<\/li>\n<li>identifiers<\/li>\n<li>Basic datatype<\/li>\n<li>User-defined datatype<\/li>\n<li>Derived datatype<\/li>\n<\/ul>\n<p><strong>Q.118. Explain in brief preliminaries of C\/C++?<\/strong><br \/>\n<strong>a)<\/strong>\u00a0<strong>Tokens<\/strong>\u00a0&#8211; The smallest individual units in a program are known as tokens. It has the following tokens:<\/p>\n<ul>\n<li>Keywords<\/li>\n<li>Identifiers<\/li>\n<li>Constants<\/li>\n<li>Strings<\/li>\n<li>Operators<\/li>\n<\/ul>\n<p>We can write a program in a C++ using tokens, white spaces and the syntax of the language.<br \/>\n<strong>i) Keywords &#8211;\u00a0<\/strong>The keyword implements specific C++ language features. They have explicitly reserved identifiers and can\u2019t be used as names for the program variables or other user-defined program elements. Some of the C++ keywords are illustrated; which are in addition to set of ANSI C keywords.<\/p>\n<ul>\n<li>Asm<\/li>\n<li>Private<\/li>\n<li>Protected<\/li>\n<li>New<\/li>\n<li>Friend<\/li>\n<li>Delete<\/li>\n<li>Operator<\/li>\n<li>inline<\/li>\n<\/ul>\n<p><strong>ii) Identifiers &#8211;<\/strong> Identifiers refer to the names of variables, functions, arrays, classes etc. created by programmers. These are the fundamental need of any language. Each language has its own rules for naming these identifiers. The following rules are common : ( both in C, C++ )<\/p>\n<ul>\n<li>Only alphabetic characters, digits and underscores are permitted.<\/li>\n<li>The name can\u2019t start with a digit.<\/li>\n<li>Uppercase and lowercase letters are distinct.<\/li>\n<li>A declared keyword can\u2019t be used as a variable name. However major difference lies in the limit of the length of a name.<\/li>\n<\/ul>\n<p><strong>b) Basic datatype<\/strong><br \/>\nC++ compilers support most of the basic data type supported by ANSI C compilers<br \/>\nChar, float, Int, char, double, void. The purpose of the data type void is contrasting. These include<\/p>\n<ul>\n<li>specifications of the return type of a function not returning any value.<\/li>\n<li>to indicate an empty argument list to a function.<\/li>\n<li>The introduction of generic pointers. E.g. void *gp;<\/li>\n<\/ul>\n<p><strong>c) User-defined datatype<\/strong><br \/>\nWe use user-defined data type structure &amp; union in C while C++ also permits to define another user-defined data type known as class, that can be used to declare variables<br \/>\n<strong>d) Derived data type <\/strong><\/p>\n<ul>\n<li>Arrays &#8211; In C++ the application of arrays is like that of C only exception being the way the character array is initialized.<\/li>\n<li>Functions &#8211; The function has undergone major change over in C++. While some of this changes are simple, others just a new way of thinking when organizing our program.Some of these were introduced to make C++ program more readable &amp; reliable<\/li>\n<li>Pointers &#8211; Pointers are declared &amp; initialized as in C<\/li>\n<\/ul>\n<p>int x;<br \/>\nint *pi;<br \/>\npi=&amp;x; etc.<br \/>\nC++ adds the concept of constant pointer &amp; pointer to constant.<br \/>\ne.g. char *const ptr1 = \u201cNEW\u201d \/\/ constant pointer<br \/>\n<strong>Q.119. How to compile and run code in R?<\/strong><\/p>\n<ul>\n<li><strong>Compiled Code &#8211;\u00a0<\/strong>R is high-level, expressive language.While C and C++ often require more lines of code to solve the same problem, they can be orders of magnitude faster than R.<\/li>\n<li><strong>Run the code &#8211;\u00a0<\/strong>We find it easiest to use Rstudio. We can also paste the code in a normal R console or let R run a source file. However, these approaches are a bit less fail-safe.<\/li>\n<\/ul>\n<p><strong>Q.120. What are debuggers and debugging techniques in R?<\/strong><br \/>\nTo complete a programming project writing code is only the beginning. After the original implementation is complete, it is time to test the program.Hence, debugging takes on great importance: the earlier you find an error, the less it will cost. A debugger allows us, the programmer, to interact and inspect the running program, making it possible to trace the flow of execution and track down the problems.<br \/>\n<strong>a) G.D.B. &#8211;<\/strong> It is the standard debugger for Linux and Unix-like operating systems.<br \/>\n<strong>b) Static Analysis &#8211;<\/strong> Searching for errors using psv studio- An introduction to analyzing code to find potential errors via static analysis, using the PVS-Studio tool.<br \/>\n<strong>c)<\/strong> Advanced Linux debugging<\/p>\n<ul>\n<li><strong>Haunting segmentation faults and pointing errors-<\/strong> Learn how to debug the trickiest programming problems<\/li>\n<li><strong>finding memory leaks and other errors with Valgrind-<\/strong> Learn how to use Valgrind, a powerful tool that helps find memory leaks and invalid memory usage.<\/li>\n<li><strong>Visual Studio-<\/strong> Visual Studio is a powerful editor and debugger for Windows<\/li>\n<\/ul>\n<p><a href=\"http:\/\/data-flair.training\/blogs\/debugging-in-r-programming\/\">Learn more about R Debugging Techniques in detail.<\/a><br \/>\n<strong>Q.121. How to use R from python?<\/strong><br \/>\n<strong>Calling R from python-<\/strong> First of all, we have to have both R and python installed. we then need to install rpy2. PANDAS recommends that we download version 2.2.x but I have used 2.3.0 without any difficulties. This is not a description of how to use R. This is presented for those that already know R and want to call it from within python to use the advanced PANDAs data manipulation tools.<br \/>\n<strong>Q.122. What is string manipulation in R?<\/strong><br \/>\nGeneric programming in an OpenCL program was restricted to using a string manipulation mechanism, where the program was constructed as a string at runtime and then passed to the OpenCL driver fronted, that will finally compile and build the kernel at runtime. Command group that call kernels can also be templated, allowing for a complex position of functors and types.<br \/>\n<a href=\"http:\/\/data-flair.training\/blogs\/r-string-manipulation-functions\/\">Learn R String Manipulation in detail.<\/a><br \/>\n<strong>Q.123. How many types of functions are there in R string manipulation?<\/strong><br \/>\nThere are 8 functions in R string manipulation respectively<\/p>\n<ul>\n<li>grep()<\/li>\n<li>nchar()<\/li>\n<li>paste()<\/li>\n<li>sprintf()<\/li>\n<li>substr()<\/li>\n<li>strsplit()<\/li>\n<li>regex()<\/li>\n<li>gregexpr()<\/li>\n<\/ul>\n<p><a href=\"http:\/\/data-flair.training\/blogs\/r-string-manipulation-functions\/\">Learn R String Manipulation functions in detail.<\/a><br \/>\n<strong>Q.124. What is the regular expression in R string manipulation?<\/strong><br \/>\nA set of strings will define as regular expressions. We use two types of regular expressions in R, extended regular expressions (the default) and Perl-like regular expressions used by perl = TRUE.<br \/>\n<strong>Q.125. What is regular expression syntax?<\/strong><br \/>\nIt specifies characters to seek out, with information about repeats and location within the string. This will practice with the help of metacharacters that have a specific meaning: $ * + . ? [ ] ^ { } | ( ) \\<br \/>\n<strong>Q.126. What is the Use of String Utilities in the edtdbg Debugging Tool in R string manipulation?<\/strong><br \/>\nThe internal code of the edtdbg debugging tool makes heavy use of string utilities. A typical example of such usage is the dgbsendeditcmd() function:<br \/>\n[php]# send command to editor<br \/>\ndbgsendeditcmd &lt;- function(cmd) {<br \/>\nsyscmd &lt;- paste(&#8220;vim &#8211;remote-send &#8220;,cmd,&#8221; &#8211;servername &#8220;,vimserver,sep=&#8221;&#8221;)<br \/>\nsystem(syscmd)<br \/>\n}[\/php]<br \/>\nThe main point is that edtdbg sends remote commands to the Vim text editor. For instance, if we are running Vim with a server name of 168 and we want the cursor in Vim to move to line 12, we could type this into a terminal (shell) window:<br \/>\nvim &#8211;remote-send 12G &#8211;server name 168<br \/>\nThe effect would be the same as if you had typed.<br \/>\nThis was all on R interview Questions and Answers<br \/>\nHence, this blog covered the R Interview Questions and answers for both levels i.e R Interview Questions and Answers for Freshers and R Interview Questions and Answers for Experienced.<br \/>\nIf you feel any Query in any R Interview Questions, so feel free to share with us. We will be glad to help you out.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>1. R Interview Questions and Answers In our previous R blog, we have discussed all the topics related to R Programming in detail. In this blog, we are going to provide you a top&#46;&#46;&#46;<\/p>\n","protected":false},"author":6,"featured_media":42608,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[51],"tags":[11210,11211,11212,11243],"class_list":["post-4513","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-r","tag-r-interview-questions-and-answers","tag-r-interview-questions-for-experienced","tag-r-interview-questions-for-freshers","tag-r-programming"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>125 R Interview Questions and Answers For Freshers &amp; Experienced - DataFlair<\/title>\n<meta name=\"description\" content=\"Top 125 R Interview Questions and Answers cover Basic R Interview Questions for Freshers and Advanced R Interview Questions for Experienced for R Interview.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/data-flair.training\/blogs\/r-interview-questions\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"125 R Interview Questions and Answers For Freshers &amp; Experienced - DataFlair\" \/>\n<meta property=\"og:description\" content=\"Top 125 R Interview Questions and Answers cover Basic R Interview Questions for Freshers and Advanced R Interview Questions for Experienced for R Interview.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/data-flair.training\/blogs\/r-interview-questions\/\" \/>\n<meta property=\"og:site_name\" content=\"DataFlair\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/DataFlairWS\/\" \/>\n<meta property=\"article:published_time\" content=\"2017-10-16T06:47:21+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-08-25T11:56:28+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/10\/r-interview-questions-and-answers-2.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"628\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"DataFlair Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:site\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"DataFlair Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"52 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"125 R Interview Questions and Answers For Freshers &amp; Experienced - DataFlair","description":"Top 125 R Interview Questions and Answers cover Basic R Interview Questions for Freshers and Advanced R Interview Questions for Experienced for R Interview.","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:\/\/data-flair.training\/blogs\/r-interview-questions\/","og_locale":"en_US","og_type":"article","og_title":"125 R Interview Questions and Answers For Freshers &amp; Experienced - DataFlair","og_description":"Top 125 R Interview Questions and Answers cover Basic R Interview Questions for Freshers and Advanced R Interview Questions for Experienced for R Interview.","og_url":"https:\/\/data-flair.training\/blogs\/r-interview-questions\/","og_site_name":"DataFlair","article_publisher":"https:\/\/www.facebook.com\/DataFlairWS\/","article_published_time":"2017-10-16T06:47:21+00:00","article_modified_time":"2021-08-25T11:56:28+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/10\/r-interview-questions-and-answers-2.jpg","type":"image\/jpeg"}],"author":"DataFlair Team","twitter_card":"summary_large_image","twitter_creator":"@DataFlairWS","twitter_site":"@DataFlairWS","twitter_misc":{"Written by":"DataFlair Team","Est. reading time":"52 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/data-flair.training\/blogs\/r-interview-questions\/#article","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/r-interview-questions\/"},"author":{"name":"DataFlair Team","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/2c58ecb4f73a39f0ef993f1ddfcd7b89"},"headline":"125 R Interview Questions and Answers For Freshers &amp; Experienced","datePublished":"2017-10-16T06:47:21+00:00","dateModified":"2021-08-25T11:56:28+00:00","mainEntityOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/r-interview-questions\/"},"wordCount":10466,"commentCount":2,"publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/r-interview-questions\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/10\/r-interview-questions-and-answers-2.jpg","keywords":["R interview Questions and Answers","R Interview Questions for Experienced","R Interview Questions for Freshers","R programming"],"articleSection":["R Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/data-flair.training\/blogs\/r-interview-questions\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/data-flair.training\/blogs\/r-interview-questions\/","url":"https:\/\/data-flair.training\/blogs\/r-interview-questions\/","name":"125 R Interview Questions and Answers For Freshers &amp; Experienced - DataFlair","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/r-interview-questions\/#primaryimage"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/r-interview-questions\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/10\/r-interview-questions-and-answers-2.jpg","datePublished":"2017-10-16T06:47:21+00:00","dateModified":"2021-08-25T11:56:28+00:00","description":"Top 125 R Interview Questions and Answers cover Basic R Interview Questions for Freshers and Advanced R Interview Questions for Experienced for R Interview.","breadcrumb":{"@id":"https:\/\/data-flair.training\/blogs\/r-interview-questions\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/data-flair.training\/blogs\/r-interview-questions\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/r-interview-questions\/#primaryimage","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/10\/r-interview-questions-and-answers-2.jpg","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/10\/r-interview-questions-and-answers-2.jpg","width":1200,"height":628,"caption":"125 R Interview Questions and Answers For Freshers &amp; Experienced"},{"@type":"BreadcrumbList","@id":"https:\/\/data-flair.training\/blogs\/r-interview-questions\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog Home","item":"https:\/\/data-flair.training\/blogs\/"},{"@type":"ListItem","position":2,"name":"R Tutorials","item":"https:\/\/data-flair.training\/blogs\/category\/r\/"},{"@type":"ListItem","position":3,"name":"125 R Interview Questions and Answers For Freshers &amp; Experienced"}]},{"@type":"WebSite","@id":"https:\/\/data-flair.training\/blogs\/#website","url":"https:\/\/data-flair.training\/blogs\/","name":"DataFlair","description":"Learn Today. Lead Tomorrow.","publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/data-flair.training\/blogs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/data-flair.training\/blogs\/#organization","name":"DataFlair","url":"https:\/\/data-flair.training\/blogs\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","width":106,"height":48,"caption":"DataFlair"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/DataFlairWS\/","https:\/\/x.com\/DataFlairWS","https:\/\/www.linkedin.com\/company\/dataflair-web-services-pvt-ltd\/","https:\/\/www.youtube.com\/user\/DataFlairWS"]},{"@type":"Person","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/2c58ecb4f73a39f0ef993f1ddfcd7b89","name":"DataFlair Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/1ce4a0e3e542444fc73bbebf83e89e8b73e2d95ccb1fcee64da9945f078b97c5?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/1ce4a0e3e542444fc73bbebf83e89e8b73e2d95ccb1fcee64da9945f078b97c5?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/1ce4a0e3e542444fc73bbebf83e89e8b73e2d95ccb1fcee64da9945f078b97c5?s=96&d=mm&r=g","caption":"DataFlair Team"},"description":"The DataFlair Team provides industry-driven content on programming, Java, Python, C++, DSA, AI, ML, data Science, Android, Flutter, MERN, Web Development, and technology. Our expert educators focus on delivering value-packed, easy-to-follow resources for tech enthusiasts and professionals.","url":"https:\/\/data-flair.training\/blogs\/author\/dfteam2\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/4513","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/comments?post=4513"}],"version-history":[{"count":6,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/4513\/revisions"}],"predecessor-version":[{"id":35856,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/4513\/revisions\/35856"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media\/42608"}],"wp:attachment":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media?parent=4513"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/categories?post=4513"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/tags?post=4513"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}