Introduction
These are som practice works in R programming
Day 1
12-July-2021
Create and save new script with name 'first class'
Assign value 36475 to variable name 'First_variable'
Add the following numbers 176.25, 23, 168476
Subtract 143287 from 74367
Multiply 175 with 83645
Find 27365^23
Divide 97 by 79
Store the values 221, 442, 663, 884, 1105 to a vector with name 'Counts'
Multiply Counts with 2
Day 2
13-July-2021
Create a vector with 20 elements in it and find its sum
Create a matrix with 18 elements with 6 rows both by row and column wise
Access 3rd row 3rd column element of it
Access 5th row 2nd column element of it
Access 2nd row 1st column element of it
Install packages 'ggplot2' and 'plotly'
Day 3
14-July-2021
Set working directory to a folder (create ) called Data Science
Create a vector with any number of elements of choice and find the number of elements in it using command, find sum of the elements and find average
Create a vector of strings with any number of elements of choice and find the number of elements in it using command.
Use any data set from R (find using data()) and find its dimension and structure.
store 990 in a variable name and use class() function to find the class it is stored
Create 2 matrices of same size preferably square matrix. Display their dimension and find transpose and trace.
Day 4
15-July-2021
Create and save a new script with your name and date and do the following operations
Assign a value 279857 to a variable name 'number_of_persons_in_college'
Add the following numbers 6187.599, 23, 9648200.01
Subtract 143287 from 74376
Multiply 999 with 1200
Find 2953^3
Divide 97 by 23
Store the values 221,442,663,884,1105 to a vector with name "kilometers"
Find thrice the times of kilometers
Create a vector with 7 elements in it and find its sum
Create a matrix with 16 elements with 4 rows both by row and column wise store it as Ex1 and Ex2
Access 3rd row 3rd column element of the matrices
Access 4th row 2nd column element of them
Access 2nd row 1st column element of them
Set working directory to a folder (create ) called Data Science
Create a vector with any number of elements of choice and find the number of elements in it using command, find sum of elements and find average using command
Create a vector of strings with any number of elements of choice and find the number of elements in it using command
Use iris data set and find its dimension and structure and summary.
Display its 5th column
Display 80th Row
Access 4th column 3rd row element
Create 3 matrices of same size preferably square matrix
Display their dimension and find transpose and trace
Day 5
16-July-2021
Week 1 assignment Please go through the questions carefully and answer. some questions might be tricky
Create a sequence of consecutive numbers starting from
1:100
207.6 to 22
-22.78 to 28 (please comment what is the difference between the numbers in the sequence)
Create a sequence of 70 numbers starting from 260085.23 to 1961029
Create a matrix with elements from 10 to 20000 (size of matrix should be 50x20)
Display the matrix
Display 3rd column 20th row element
Create the following vectors
science with values 1,2,3,4
maths with values 29,43,37,199
Find sum, difference, element wise product and dot product of the vectors
Create two matrices of size 5x5 perform all matrix operations discussed so far
Assign any new data of your choice (which is not discussed in class)
Display dimension of data
Obtain a glimpse of data using code
Subset 5th row from data
Display each column in data using names
Summarize the data
Create a string vector with elements 1,12,32,'key'
Save a value 9000 to variable_1
Save '9000' to variable_2
Save 1909 to variable_3
Compare the above 3 variables for equality, inequality, less than, greater than
Check whether 99.101 is present in Sepal.Width column of iris data
Send a small write up in a word file about your understanding of data types with examples around you
Week 3 work 1
26-July-2021
Use appropriate operator to find whether 1.072 exists or not in "density" variable of 'DNase' dataset
Store values 990,2564,331 to a variable "distance" and convert it to string
Store values "22","223","34239789670" to a variable "numbers" and Convert it to numbers and find their total and average.
Compute descriptive statistics for "DNase" data (Summarise it)
Give the dimension of data
Subset 24,54,39,100 th rows from data in single code
Week 3 work 2
27-July-2021
Use operator -> for assignment below
Assign 547 to name- total
Assign 345 to name- Present
Assign string 'Welcome to class' to name- greet
Use operator <- for assignment below
Assign 225,110,150 to name- CC
Assign 175,117,158 to name- weight
Assign string "fastest","medium","fast" to name- nature
Create matrices of size 3x3
Using vector as input
Using sequence as input
Using string vector 'The', 'purpose', 'of', 'our', 'lives', 'is', 'to', 'be', 'happy' as input
Create 4 different arrays of size of your choice
Load Credit Dataset in to R
Display summary
Display dimension
Display structure
Week 3 work 3
28-July-2021
Set working directory to a new folder with name 'assignments'
Create a list with number elements of your choice with different types of elements in them
Assign single values to variable names A,B and C Perform all combinations of logical operations
Load Wage data and find Structure,dimension and descriptive statistics
Obtain barplot of variables region, education, race
- Give title, axes labels and play around with color
Week 3 work 4
29-July-2021
Load Credit dataset to R
Display Barplot of Ethnicity.
- Change color,title,axes names, subtitle,borderobtain horizontal plot
Histogram for Balance
- Change color,title,axes names, subtitle
Histogram for Income
- change color,title,axes names, subtitle, change break value
Scatter plot of Limit and Balance
- Change color,title,axes names, subtitle
Scatter plot of Limit and Balance
- Give color based on Ethnicity
- Give title,axes names, subtitle,
Obtain pie chart of Ethnicity
- Customise color
Choose any 4 different plots and display in single window
Week 3 final
31-July-2021
Check for current working directory and set working directory to a folder of your choice
Store values
7088000 to name People
1189 to name Area
Chennai to name Place
Perform logical operations for all combination of 3 variables above
Less than
Less than or equal to
Greater than
Greater than or equal to
Check for equality
Check for inequality
Create a vector of elements of your choice and find number of elements in it, total and average
Create 2 vectors of numbers of 25 elements
- Find sum, difference, element wise product and dot product
Create a matrix of size 5X5 using vector of numbers and store it to mat_a
Create a matrix of size 5X5 using sequence and store it to mat_b
- Perform matrix addition, subtraction, element wise multiplication and matrix multiplication
Load iris dataset
Display dimension, structure
Find Descriptive statistics
Obtain histogram of Sepal.length
Barplot of species
Scatter plot of petal.length and petal.width
Load Wage csv dataset
- Select 2 quantitative variables and obtain
Scatter plot, give title, axes labels, change color
- Use education and obtain barplot
specify title, axes label, color etc
- Use maritl and obtain pie diagram
customise color and radius
Try different types of scatter plots with pressure dataset using variables temperature and pressure
Display 4 different plots in single window
Single Numeric
15-Aug-2021
To be submitted on 16-Aug-2021
Consider 'Midwest' dataset
Prepare META DATA
Explore the quantitaive variables in data using both Visual and Numerical summary measures
Prepare an html file with your insights.