Unit 1 &2
Unit 1 &2
Programs can be written in R in any of the widely used IDE like R Studio, Rattle,
Tinn-R, etc. After writing the program save the file with the extension .r. To run the
program use the following command on the command line:
R file_name.r
arithmetic
https://intellipaat.com/blog/tutorial/r-programming/operators/
Object
https://www.geeksforgeeks.org/r-objects/
https://intellipaat.com/blog/tutorial/r-programming/vectors/
https://www.tutorialspoint.com/r/r_factors.htm
strings
https://www.geeksforgeeks.org/r-strings/
Math
https://www.w3schools.com/r/r_math.asp
Variable
https://www.geeksforgeeks.org/r-variables/
Vector operation
https://www.geeksforgeeks.org/operations-on-vectors-in-r/
Unit 2 Data structures in R
Data types - Generally, while doing programming in any programming language, you
need to use various variables to store various information. Variables are nothing but
reserved memory locations to store values. This means that, when you create a
variable you reserve some space in memory.
You may like to store information of various data types like character, wide character,
integer, floating point, double floating point, Boolean etc. Based on the data type of a
variable, the operating system allocates memory and decides what can be stored in the
reserved memory.
In contrast to other programming languages like C and java in R, the variables are not
declared as some data type. The variables are assigned with R-Objects and the data
type of the R-object becomes the data type of the variable. There are many types of
R-objects. The frequently used ones are −
● Vectors
● Lists
● Matrices
● Arrays
● Factors
● Data Frames
The simplest of these objects is the vector object and there are six data types of these
atomic vectors, also termed as six classes of vectors.
Arrays -
https://www.tutorialspoint.com/r/r_arrays.htm
Tables -
https://www.geeksforgeeks.org/how-to-create-tables-in-r/
Matrices : operation
https://www.w3schools.com/r/r_matrices.asp
List : operation
https://www.w3schools.com/r/r_lists.asp
Data frame : creation
https://www.w3schools.com/r/r_data_frames.asp
https://datatofish.com/create-dataframe-in-r/#:~:text=Alternatively%2C%20you
%20may%20apply%20this,%22%2C%20...)%20)
Factors-
https://www.w3schools.com/r/r_factors.asp
Reading -
https://makemeanalyst.com/r-programming/reading-and-writing-data-to-and-from-r/