R PROGRAMMING

R MCQs'-Q.doc

MCQs'-Questions

R MCQs'-S.doc

MCQs'-Solution

Why R?

R is not a programming language like C or Java. It was not created by software engineers for software development. Instead, it was developed by statisticians as an interactive environment for data analysis.

Features of R

  1. R is free and open source.

  2. It runs on all major platforms: Windows, Mac OS, UNIX/Linux.

  3. Scripts and data objects can be shared seamlessly across platforms.

  4. There is a large, growing, and active community of R users and, as a result, there are numerous resources for learning.

  • https://stats.stackexchange.com/questions/138/free-resources-for-learning-r↩︎

  • https://www.r-project.org/help.html↩︎

  • https://stackoverflow.com/documentation/r/topics↩︎

  1. It is easy for others to contribute add-ons which enables developers to share software implementations of new data science methodologies. This gives R users early access to the latest methods and to tools which are developed for a wide variety of disciplines, including ecology, molecular biology, social sciences, and geography, just to name a few examples.

CRAN

Comprehensive R Archive Network

What is R programming used for?

R provides a conducive environment for statistical computing and design by providing a large range of statistics - related libraries. Furthermore, because it is useful for data importing and cleaning, many quantitative analysts utilize the R programming language as a programming tool.

What are the object types in R?

Character, numeric, integer, complex and logical are data types in R.

How do I list objects in R?

To retrieve a vector of character strings containing the names of all items in the environment, use the objects() or ls() functions. The names in the result are arranged in alphabetical order.

What are data types in R?

Character, numeric, integer, complex and logical are data types in R.

How many types of data types are there in R?

a number - (1L, 55L, 100L where the letter "L" declares this as an integer)

9+2i (where I denotes the imaginary portion)

character (also known as a string) - ("k", "FALSE","12.4")

How do you use vectors in R programming?

Using c() function. To create a vector, we use the c() function:

Code:

vec <- c(1,2,3,4,5)

#creates a vector named vec

The assign() method is used. The assign() method is another technique to make a vector.

digit code operator is being used. The : operator is a simple way to create integer vectors.

How do lists work in R?

The R list is an object contains items of various types such as strings, numbers, vectors and another list. The members of a R list can alternatively be a matrix or a function.

How do you use matrices in R?

In R, you must use the matrix function to create a matrix(). The set of elements in the vector are the arguments to this matix(). you must specify the number of rows and columns that you want in your matrix.

Note: By default matrices are ordered in column-wise order by default.