R Programming Interview Questions & Answers for 2017

Sabrina Susan
Jul 21, 2017 · 2 min read
R Programming

1) What is the default data type in which the data get stored in R ?

Numeric

2) What are the different data types in R ?

Numeric, Integer, Character, Complex, and Logical

3) What is the difference between a matrix and a dataframe?

A dataframe can contain heterogenous inputs and a matrix cannot.

4) ) If I concatenate a number and a character together, what will the class of the resulting vector be?

Character

5) If I concatenate a number and a Logical together, what will the class of the resulting vector be?

Number

6) What is the difference between seq(4) and seq_along(4)?

seq(4) produces a vector from 1 to 4 (c(1, 2, 3, 4)), whereas seq_along(4) produces a vector of length(4), or 1 (c(1)).

7) How missing values are represented in R?

Answer: NA, impossible values as NaN

8) Problem : x = function(a,b) { print a, print b} x(2) What will be the output of this function call?

Ans : [1] 2

Error: Argument missing — This is because of lazy evaluation

9) What is the use of the … parameter in while defining a function?

It will help us to call the other parameter functions into our function without having explicitly defined it.

10) What does tapply() function do?

It is used to compute the function() for the subset and give us the results based on a variable.

Get more Interview Question for below courses

Original source from : TraininginBangalore.in

)
Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade