September 18, 2018

Sreekanth B

Symantec R Programming Recently Asked Interview Questions Answers

Is R is a slow language?

R programs can be slow, but well-written R programs are usually fast enough.
Speed was not the primary design criteria.
Designed to make programming easier.
Slow programs often a result of bad programming practices or not
understanding how R works.
There are various options for calling C or C++ functions from R.

Explain main features to write R code that runs faster?

R is a popular statistical software which is famous for the enormous amount of packages. R’s 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.

Use matrix instead of data frame whenever possible. Actually data frame cause problem in many cases. Only use data frame when necessary.
Use double(n) to create a vector of length n instead of using code rep(0,n), and similar to others.
Split big data object (e.g., big data frame or matrix) to smaller ones, and operate on these smaller objects.

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.
Use vector and matrix operation if possible. Theses *apply functions are very helpful for this purpose.
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.
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.
Symantec R Programming Recently Asked Interview Questions Answers
Symantec R Programming Recently Asked Interview Questions Answers
What is SAS and SPSS in R?

SAS stands for Statistical Analysis System. 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.

Why is R important for data science?

We can run your code without any Compiler – R is an interpreted language. Hence we can run Code without any compiler. R interprets the Code and makes the development of code easier.
Many calculations done with vectors – 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.
Statistical Language- R used in biology, genetics as well as in statistics. R is a turning complete
a language where any type of task can be performed.

Explain What is R?

R 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’s 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’s 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 > character.

What is GUI in R?

GUI stands for Graphical User Interfaces. R is a command line driven program. The user enters commands at the prompt ( > 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.

What is CLI in R?

CLI stands for Command Line Interface. 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

What is data mining and what data miners do in R?

R and Data Mining introduces researchers, post-graduate students, and analysts to data mining using R, a free software environment for statistical computing and graphics.

Who and When R discovered?

R 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.

Why is R Good for business?

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.
For data-driven business, data science talent shortage is a very big problem. Companies are
using R programming as their platform and recruit trained users of R.

What is Visualization in R?

Visualization 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.

What are R topical programming and statistical relevance?

a) Statistical

R is free, open source software.
R is available from free software Foundation.
b) Programming

Data inputs such as data type, importing data, keyboard typing.
Data Management such as data variables, operators.

What are statistical and programming features of R?

a) Statistical Features-

Basic Statistics: Mean, variance, median.
Static graphics: Basic plots, graphic maps.
Probability distributions: Beta, Binomial.

b) Programming Features-

Distributed Computing: 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.
R packages – R packages are a collection of R functions, compiled code and sample data. By default, R installs a set of packages during installation.

What are the advantages of R?

R is the most comprehensive statistical analysis package as new technology and ideas often appear first in R.
R is open-source software. Hence anyone can use and change it.
R is an open source. We can run R anywhere and at any time, and even sell it under conditions of the license.
R is good for GNU/Linux and Microsoft Windows. R is cross-platform which runs on many operating systems.
In R, anyone is welcome to provide bug fixes, code enhancements, and new packages.

What are Descriptive analysis methods in R?

Observation Method – There are two ways to draw the meaningful conclusion: Artificial & Natural.
Survey Method – In this method, questionnaires prepares and given to the participants. Hence After receiving the answers, the research preceded and results concluded.
Case Method – It involves a deep study of all the problems discussed. Thus, it makes us understand a particular situation.

What is R studio and how to use it?

a) USING RSTUDIO

step 1: Download and install Rstudio.
step 2: Open RStudio and do this:
step 3: Click on the menu: File -> New -> R Script
step 4: Paste the code in the new source code area
step 5: Click the “Source” button above the code area:

We can also use the console in RStudio. If we click “Run” instead of “Source” user input might not work properly. We can use the R documentation like this: help(function.name).

Using the R console – Running the r program on the command line or elsewhere will start the console. we can paste your code there.
Problems with this approach – If we use source(“filename.r”) to run your code then it will surely work. But If we paste the code some of it might be read as user input.
Running a source file with R – We can run a source file like this: r -f filename.r.
R also provides a lot of other command line arguments

What are R data types?

In 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.


Subscribe to get more Posts :