R Programing Interview Questions

A random walk is the simplest example of a non-stationary process. A random walk has no specified mean or variance, strong dependence over time, and its changes or increments are white noise. Simulating random walk in R :

**arima.sim(model=list(order=c(0,1,0)),n=40)->rw ts.plot(rw)**

It is a basic time series model and a simple example of a stationary process. A white noise model has a fixed constant mean, a fixed constant variance, and no correlation over time. We can simulate a white noise model in the following way :

**arima.sim(model=list(order=c(0,0,0)),n=50)->wn**

Simple and effective programming language.

Broadly speaking these are different components in grammar of graphics :

RMarkdown is a reporting tool provided by R. With the help of Rmarkdown, you can create high quality reports of your R code.

The output format of Rmarkdown can be :

library() |
require() |

function gives an error message display, if the desired package cannot be loaded. |
function is used inside function and throws a warning messages whenever a particular package is not Found |

It loads the packages whether it is already loaded or not, | It just checks that it is loaded, or loads it if it isn’t (use in functions that rely on a certain package). The documentation explicitly states that neither function will reload an already loaded package. |

```
if(!require(package, character.only=T, quietly=T)) {
install.packages (package)
library(package, character.only=T)
}
```

```
for(package in c('', '')) {
if(!require(package, character.only=T, quietly=T)) {
install.packages (package)
library(package, character.only=T)
}
}
```

It is used to determine that the means of two groups are equal or not by using

**t.test()**

function.The disadvantages are :

**with()**

function applies an expression to a dataset.**#with(data,expression)**

**By()**

function applies a function t each level of a factors.**#by(data,factorlist,function)**

The solutions available are referred to as “packages” in R, so be sure to use this term in your answer. First, explain that the CRAN package ecosystem has an extensive amount of packages available (over 6,000) to solve potential issues. Each R user might have their own way of making their selection, but the best way to answer this question is to explain how reviews from others go a long way: Were other R users with similar issues able to solve their problems with a particular package? If so, were these issues similar to the problems you’re encountering? In your answer, explain that you’d be wary of packages that don’t encompass good software development principles, have poor reviews, or are lacking reviews altogether.