/    /  R programming – Interview questions Part 1

1. What is R?

Answer: R is a programming language which is used for developing statistical software and data analysis. It is being increasingly deployed for machine learning applications as well.

 

2. Explain the data import in R language.

Answer: R provides to import data in R language. To introduce with the R commander GUI, user should type the commands in the command Rcmdr into the console. Data can be carried out in R language in 3 ways such as:

1. Firstly, Select the data set in the dialog box or enter the name of the data set as required.

2. Then the Data is entered directly using the editor of R Commander via Data->New Data Set. Hence, this works well only when the data set is not too large.

3. Even the Data can also be imported from a URL or from plain text file (ASCII), or from any statistical package or from the clipboard.

 

3. How to communicate the outputs of data analysis using R language.

Answer: Combine the data, code and analysis results in a single document using knitr for Reproducible research done. Helps to verify the findings, add to them and engage in conversations. Reproducible research makes it easy to redo the experiments by inserting new data values and applying it to different various problems.

 

4. How R commands are written?

Answer: By using # at the starting of the line of code like #division commands are written.

 

5. What is t-tests () in R?

Answer: It is used to determine that the means of two groups are equal or not by using t.test() function.

 

6. What are the disadvantages of R Programming?

Answer: The disadvantages are:-

1. Lack of standard GUI

2. Not good for big data.

3. Does not provide spreadsheet view of data.

 

7. Explain what is the use of With () and By () function in R?

Answer: 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)

 

8. In R programming, how missing values are represented?

Answer: In R missing values are represented by NA which should be in capital letters.

 

9. What is the use of subset() and sample() function in R?

Answer: Subset() is used to select the variables and observations and sample() function is used to  generate  a random sample of the size n from a dataset.

 

10. Explain what is transpose.

Answer: Transpose is used for reshaping of the data which is used for analysis. Transpose is performed by t() function.